+12

What is difference between " = " and " == " ??

1/10/2017 9:27:29 AM

Himanshu Singh

40 Answers

New Answer

+55

= is assignment, like if you wanna assign x as 2, you do int x = 2. == is comparison, if you wanna compare x and 2, you do if (x == 2), either true or false.

+8

"=" is an assignment operator which is used to assign value to the variable ex: int b=7; "==" is a relational operator which is used to find the relation between two operands and returns in boolen value either 'true' or 'false' example: 5==5 Condition true Returns 1 or true

+4

single `=` means you are giving the value example a=2 and == means equal sign with this will returm is true or false example 1==1

+3

= as in x=2 says give x the value of 2. Then on x's value will be two. This is an assignment operator as ot assigns x a value of two. == as in if(x==2) checks whether x has a value of 2. this is a relational operator as it looks how two things are similar dissimilar of do they fall in the same category like if (x <2).

+3

= is used for assigning value eg- x=3 y=3 == is used for comparing whether the value is equal eg- if(x==y) comparing whether x is equal to y.

+3

first one is assignment operator, and second one is equal operator

+2

= is a assignment operator but == is logical operator

+2

= also known as the assignment operator it assigns the value of its right hand side element to the value of its left hand side .I. e if a=b then the value of b is assigned to a on the other hand == is used for the comparison of elements other than string types

+2

(=) is a Assignment Operators, for assigning a value to a variable. (==) is a Relational Operators, checks the relationship between two operands. Example: x = 10; Now 10 is assign to the variable x. 5 == 10; checks whether the relation is equal or not.

+2

some compilers will warn you, but you need to be careful not to put something like "if (x=5)" since this will return true and assign 5 to x regardless of what x is.

+2

"=" is used to assign the value. Example: x = 2, then value of x is 2. "==" is to show equality between values, Example x == y, here the value of y equal to x.

+1

= is assignment operator, == is relational operator. using = we can assign a value to a variable, with == compare two operands.

+1

"=" mean equal to example x=4 output 4 but "==" mean logical example x==x output True

+1

"=" is used to assign a value to variable whereas "==" is used to compare a variable with a value or other variable. e.g int x=2; (x==2) or (x==y).

+1

=assignment operator == operator overloading

+1

= assigns a value to a variable == is like the "equals sign" in c++

+1

= is a assignment operator. ex : var x = "foo"; == is a equality operator. ex : if ( x == y ) , checking variable x and y values are equals.

+1

= is assignment operator. say x = 5, assigns value 5 to variable x. == is conditional equal to operator. we will typically use == this for checking the value. x==5 will check whether the value of x is 5.

+1

................................................................................................................................. =this (EX). z=2...x=5...y=6.etc. but ==this (EX). z=100 and x=50*2 then z==x .................. .................. .................. = this we use it when we have only 1 element ( z=anything... x=anything... etc.) but ==this we use it when we compare between two or more elements ( this elements are equal) .................. .................. .................. (EX). z=100...x=50*2...y=200÷2...then z==x==y ................................................................................................................................. follow me =you will happy follow me =I will happy follow me ==we will happy .................................................................................................................................

+1

= is the assignment operator. use it to assign a value to a variable. == is a conditional operator that checks to see if two values/variables are equal. Returns true or 1 if true, and false or 0 if false.