+ 2
Is there any difference between = and ==?
10 Answers
+ 7
= is a assignment operator and == is a comparison operator
example .
int a=5; // the value of a became 5
if(a==5)// comparing a's value with 5
+ 1
@Queenoftheworld = is the assignment operator which assigns the value on the right to the variable on the left. Example:
int x = 10;
assigns the value 10 to the variable named x. Whereas == is the equality operator which checks if the value (of the variable) on the right is equal to the value (of the variable) on the left. Example:
bool isEqual = x == y;
checks if the value of x is equal to the value of y. And assigns the result ('true' or 'false') to the isEqual variable.
+ 1
= is for assignment operator and == is for equal to operator
+ 1
=is assignment operator == is a comparison operator
0
= is Assignment operator
That is....
a=5;
b=a+b;
== is equality operator
That is.....
if(a==5)
{
âŠâŠâŠâŠâŠ
}
0
= means assuming the value some other declared variables .where ==means comparing the declared variable's value with some declared variable's value
0
The '='(assignment operator) is to assign the value of rhe variable,whereas '=='(relational operator) is to compare to values.
HOPE this may help you .
PEACE\/.
0
yaa they is an difference = means assigning some values and == means comparison of some values
- 1
yes it has the difference
- 1
yes it's meaning change when we write it as 8=D and 8==D . it gets bigger