answersLogoWhite

0


Best Answer

The = operator is the assignment operator.

The == operator is the equality or equals operator.

The = operator is the assignment operator. We use it to assign a value (the right hand operand) to an object (the left hand operand). The value must be of the same type as the object unless the value can implicitly convert to the object's type. If not, we must explicitly cast the value to the appropriate type. The operator evaluates to the value of the object after assignment, thus creating a temporary value that can be used in other expressions.

Examples:

int you;

you = 10; // assign the value 10 to the object named 'you'

int me, you;

me = 10;

you = 10;

Note that the second example can also be written:

int me, you;

me = you = 10;

This is because the expression 'you = 10' evaluates to the temporary value 10 (the value of 'you' after assignment) which we then assign to 'me'. Operators are evaluated according to operator precedence, and assignment 'chains' like this are always evaluated from right to left.

The == operator is the equality or equals operator. We use it to determine if two object's have the same value. If so, the expression evaluates true, otherwise false. Operators that evaluate true or false are known as Boolean operators (functions that return true or false are known as predicates).

Typically we use the == operator in conditional expressions:

if (a == b) {

// code to execute when the value of a is equal to the value of b

} else {

// code to execute when the value of a is not equal to the value of b

}

while (a == b) {

// This code will loop repeatedly so long as a is equal to b at the beginning of each iteration

}

The == operator is one of six Boolean operators that can be used to compare object values:

== : equal

!= : not equal

< : less than

<= : less than or equal

> : greater than

>= : greater than or equal

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between you equals 10 and you equals equals 10 in c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between 2 and 10?

2 is decimal format in computer language. 2 can be represented as 10 in binary format.


What is the difference between 45 and the average of 20 35 45 and 20?

The average equals 30. So 10


What is the difference between 0.3 and3?

0.3 is the same as 3 tenths of one (1.0) This can be written as 3 /10 or 3 over ten Whereas 3.0 is equal to 30/10 Or If you want the mathematical answer 3/10 +7/10 + 2.0 equals 3.0 the difference between 0.3 + 3.0 equals 2.7


What is the difference between a kilogram and a hectogram?

A kilogram is much bigger than a hectogram. One Kilogram equals 10 hectograms.


What is 303 minis 10?

The difference is 303 minus 10 equals 293


What is the difference between -4 and 6?

The difference is 10


How many decimeters equal 10 meters?

100 decimeters = 10 meters; 10 decameters = 100 meters.Watch out for the difference between "decimeter" and "decameter."


What is the difference between two numbers is 10 If the numbers are doubled what is What is the difference between them?

the difference is also doubled


What is the difference between 10 and 20 volume creme developer?

What is the difference between 10 and 20 volume creme developer?


What is the difference between 1 and 10?

The difference between 1 and 10 is 9. or When you add a zero to the right side of the number 1 it becomes 10.


what are two numbers that have a sum of 35 and a difference of 15?

25 plus 10 equals 35 and 25 minus 10 equals 15. Hope this helps!


What is the difference between 10 and -5?

15