Important MCQ

The operator == is used to

Q.The operator == is used to

A) end a statement
B) compare two values for equality
C) add two values
D) assign a value
Correct Answer:
Option B
Detailed Explanation:
B) compare two values for equality is correct. Relational operators compare values and return true (1) or false (0). The assignment operator = is different from the equality operator ==; zero is false and non-zero values are true in conditions.