1.

Write the difference between x = 5 and x ==5 in C++.

Answer»

x = 5 means the value 5 of the RHs is assigned to the LHS variable x . Here = is the assignment operator. But x ==5, ==this is the relational (comparison) operator. Here it checks whether the value of RHS is equal to the value of LHS and this expression returns a boolean value as a result. It is the equality operation.



Discussion

No Comment Found

Related InterviewSolutions