0
Whats difference between a= and a==
4 Answers
+ 2
a= is assign a value (because = is an assignment operator)
where as a== is a conditional statement use in if loop( because == is an conditional operator)
+ 1
'=' assigns a value usually to a variable.
'==' is used to test if a variable is equal to another variable, this is usually used as a test in loops.
0
= is assignment operator. == is a boolean operator (tests if a is the same as other variables
0
Extending on the other two answers. The assignment operator looks at what's on the right and makes what's on the left the same value.
The equality operator on the other hand checks if what's on the right is equal to what's on the left; if it is then it returns 1, else it returns 0. Be very careful comparing multiple variables against one another as it will compare against those 1's and 0's if you mix some of the logic up.