Deference between x=y and x==y? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 11

Deference between x=y and x==y?

28th Jul 2018, 1:35 PM
Praful Dhale
25 Answers
+ 16
If both x and y are int, x=y will change value of x. x==y will give true or false as the output
28th Jul 2018, 1:43 PM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 14
x = y, means that the value of x becomes the value of y. x == y compares the two values and returns true if they are equal and false if they are different.
28th Jul 2018, 1:38 PM
Moritz Vogel
Moritz Vogel - avatar
+ 12
in x=y condition x acquires the value of y
12th Aug 2018, 10:20 PM
Mradul Uttam
Mradul Uttam - avatar
+ 4
You only have the C++ course on your profile so I choose a C++ related question
28th Jul 2018, 1:37 PM
TurtleShell - avatar
+ 3
The first will change x to y if they are integers. The second will activate booleans.
9th Aug 2018, 9:26 PM
Ömer Eren
Ömer Eren - avatar
+ 3
The data in variable y is transferred to x. x==y value of x is equal to y.
10th Aug 2018, 9:18 PM
Apple Blossom
Apple Blossom - avatar
+ 3
x=y means we are assigning y value to x. x==y means we are comparing whether x is equal to y or not.
12th Aug 2018, 2:27 PM
Ramya - avatar
+ 3
x=y : means allocation(or command to copy each and every bit of y to x) of the value of the variable currently holding by the variable named by 'y' to the variable named by 'x'; And x==y: means forcing the CPU to send the value of both 'x' and 'y' to the stack memory region of the program and '==' commanding the ALU to compare each bit of the variables ...
25th Aug 2018, 4:33 PM
Liton Barman
Liton Barman - avatar
28th Jul 2018, 2:01 PM
Meet Mehta
Meet Mehta - avatar
+ 1
Why are there so many, who write the same answers again, despite the question is already correctly answered?
10th Aug 2018, 9:54 PM
Moritz Vogel
Moritz Vogel - avatar
+ 1
x=y means, we are assigning the value of y to x while x==y means we are checking if x is equal to y (which can return the value of true or false).
3rd Sep 2018, 10:53 PM
Temitayo Ajakore
+ 1
First one is assignment while Second one is comparison
26th Nov 2018, 5:36 PM
Madhusudan Babar
Madhusudan Babar - avatar
x=y means we are assigning the value of y to x whereas x==y means we are comparing the values of x and y
30th Jul 2018, 5:18 AM
x=y is you assigning x to y. x==y is true or false
6th Aug 2018, 12:14 AM
DaBatman - avatar
x=y means you're assigning the variable of y to x. x==y is a relational operation which can only bring true or false results
6th Aug 2018, 10:12 PM
Peter Femi Adekunle
Peter Femi Adekunle - avatar
x=y is a statement and x==y is a condition
8th Aug 2018, 9:18 AM
Archita Saha
x=y is an assignement . You assigning x to y but x==y is comparison
8th Aug 2018, 1:03 PM
Philip Boss
Philip Boss - avatar
x=y means the value of var x = var y where x==y the value of x is equal to y which is the output
9th Aug 2018, 1:36 AM
Ashwini Kumar Mishra
Ashwini Kumar Mishra - avatar
x=y|The operator used here is the Assignment Operator(=)which assigns the value of y to x. whereas, x==y|The operator used here is the Relational operator (==) which compares the value already assigned to the variables.
9th Aug 2018, 5:43 AM
Yashpreet Singh
Yashpreet Singh - avatar
whit x=y you are assing the valor of y to x, with x==y you are telling they are equal.
27th Aug 2018, 1:43 PM
Vincenzo - avatar