- 1

What is different between (=) operator (==) operator ? Explain with example .

24th Jan 2017, 6:45 PM
Zeyad Sharo
Zeyad Sharo - avatar
4 Réponses
+ 13
= assignment (gives value to a variable) == equality (checks if var is equal to something else…)
24th Jan 2017, 6:47 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 5
Examples: int a = 4; int b = 2; int a = b; // a is given the value of b a == 2 // this is true because a has the value of 2
24th Jan 2017, 6:50 PM
Jafca
Jafca - avatar
+ 2
Thanks for the answer،😘😍
24th Jan 2017, 6:54 PM
Zeyad Sharo
Zeyad Sharo - avatar
+ 2
the = is to value to a variable, the == allows you to check if something is equal to something
24th Jan 2017, 7:09 PM
Zachary Virtualol
Zachary Virtualol - avatar