+ 2
What is the difference between = and == operators?
4 Answers
+ 14
@Jonas is correct.
= is used to assign values to a variable. E.g
int x = 16;
== is used to evaluate if LHS and RHS expression is equal in value.
if (x == 16) // do something
+ 5
= is an assignment operator, it assigns a value to a variable. == is a comparison operator.
0
single = mean it assign the value toward left side
for example y=4 this mean the value of y is 4.
double == this straghtly mean "equal"
for example y=4 and x=4 you can see both
have equal number that's way this is used.
0
thanks for the answer...!!!!