answersLogoWhite

0


Best Answer

All programming languages provide 6 built-in comparison operators:

< less than

<= less than or equal

== equal (denoted = in some languages)

!= not equal (denoted <> in some languages)

> greater than

>= greater than or equal

In C Programming, to compare any two primitive data types (X and Y) for equality, we would use the equality operator as per the following expression:

X==Y

This expression evaluates true whenever X and Y hold the same logical value, otherwise it evaluates false. We can use this expression within any statement where the expression true or false would be expected. For example:

if (X==Y) {

// do something when X and Y are equal (where X==Y evaluates true)

} else {

// do something when X and Y are not equal (where X==Y evaluates false)

}

Note that the built-in == operator can also be applied to any combination of primitive data types that can be implicitly promoted or converted to a common type. For example, comparing an int with a double will implicitly convert the int to a double, thus we are actually comparing two doubles, as per the following "named operator":

bool is_equal (int X, double Y) {

return X==Y; // implicitly the same as: return (double) X==Y;

}

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you determine if two primitives are equal in computer programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you determine if two primitives are equal in Java?

There are 9 definitions of primitive within mathematics - according to Wikipedia!


What is ghz in computer language?

Gigahertz is equal to 1,000 megahertz and is used in measuring speed of computer processing.


What is optional for python programming?

One optional part of python programming is the declaration of variables before use. In many languages, you must declare your variables before using them, but in python, you can simply set a variable equal to something and it will handle the type without your help.


Is MCA equal to engineering?

MCA is equivalent to ME (Computer Science and Engineering)MCA with B.Sc. (Computer Science) background is equivalent to ME (Computer Science and Engineering).B.Sc. Computer Science (3 Yrs) + MCA (3 Yrs) = 6Years.BE Computer Science (4 Yrs) + ME (2Yrs) = 6 Years.MCA and ME both are equal.Companies are giving equal priority to both MCA and ME.Two Master's Degrees, MCA and ME, are treated Same for jobs and there is no difference in the competence ratings.Both MCA and ME (Computer Science and Engineering) Professional Degree courses, the contents of theory and practical syllabus are Same.MCA and ME Degree holders are Equal to each other.MCA - Master of Computer Applications.ME - Master of Engineering (Computer Science and Engineering).Thanks and best regards to you all.


What is handsome number in c programming?

Handsome numbers are the numbers in which the sum of all the left side numbers is equal to the last number for example 123 - 1+2=3 its a handsome number

Related questions

How do you determine if two primitives are equal in Java?

There are 9 definitions of primitive within mathematics - according to Wikipedia!


What is a constant in computer?

In computer terms (especially in programming), a constant is a piece of data that has a set value which cannot be changed. For example, 1 and 3 are constants - they will always equal their respective values. Constants can also be set, so you could make: piValue a constant equal to 3.14.


Is microprocessor equal to computer?

yes it's equal to computer


What is the difference between a equals equals 0 and a equals 0?

One equals is used in an equation which is true, such as 5 + 3 = 8 Equals equals is used in computer programming as a question as to whether 2 things are equal. Like If x == 4 perform this operation ... If you are referring to 'C' language programming: A single equal sign is an assignment, a double equal sign is a comparison. a = 7; /* An assignment. You are assigning the value of 7 to the variable called 'a' */ if (a == 7) /* A comparison. You are checking if the variable 'a' has the value of 7 */


What does n e stand for?

'n e' typically stands for &quot;not enough&quot; or &quot;not equal to.&quot; It is commonly used in mathematics or programming to indicate that a certain condition is not met or that two values are not equal. However, without more context, it is difficult to determine the exact meaning of 'n e'.


Do electrons determine what kind of element an atom is?

The number of protons determine the element. It is equal to the atomic number. The number of electrons is equal to the number of protons only of the atom is neutral.


Why do letters equal numbers on your TI 83?

The letters are used for programming Or for entering numbers in hexadecimal notation


How do you determine if two fractions are equal?

By reducing them to their lowest terms


Greater than or equal to symbol?

Greater than or equal symbol means the left side number is greater than or equal to right side number. It is mostly used in programming.


How do we determine that the isosceles triangle is an isosceles triangle?

2 interior angles are equal and 2 sides are of equal length.


What is the symbol for not equal to?

Generally that's != or it could be &lt;&gt;. A != B A &lt;&gt; B Both are "A is not equal to B" but the first is more common. EDIT: the symbols above are used in programming, but in more simple mathematics the symbol is a ( =/= ) where an equal symbol ( = ) is slashed.


Will a regular 1 gigabyte Kingston Ram stick fit into any computer?

This depends on your motherboard. You should check the motherboard specifications to determine specifically what type of RAM you need. Not all RAM is created equal! anonymous@oola.com