Which operator is used for equality comparison in C?
A. ==
B. =
C. !=
D. <>
Answer: Option A
Solution(By Examveda Team)
In C, the == operator is used for equality comparison. It checks if the two operands are equal and returns true if they are, otherwise, it returns false.Option B (=) is incorrect as it is the assignment operator, used to assign values to variables, not for equality comparison.
Option C (!=) is incorrect as it is the "not equal to" operator, used to check if two values are not equal.
Option D (<>) is not a valid equality comparison operator in C.
Related Questions on Operators and Expressions
What does the ++ operator do in C when applied to a variable?
A. Decrements by 1
B. Adds 1
C. Doubles the value
D. Leaves it unchanged
Join The Discussion