Difference between assignment operator(=) and equality operator (= =) :


Difference between assignment operator(=) and equality operator (= =) :
Assignment operator and equality operator are different but they are similar in reading . = operator is used to assign value and = = operator is used to said equal.
Be careful! The operator = (one equal sign) is not the same as the operator = = (two equal signs), the first one is an assignment operator (assigns the value at its right to the variable at its left) and the other one (= =) is the equality operator that compares whether both expressions in the two sides of it are equal to each other. Thus, in the last expression ((b=3) = = a), we first assigned the value 3 to b and then we compared it to a, that also stores the value 3, so the result of the operation is true.