Vidyalelo
C Programming · Q8

Operators and Expressions

Programming · C Programming · question 8

Q8

Which operator is used for equality comparison in C?

A.
==
Answer
B.
=
C.
!=
D.
<>

Answer: Option A

Solution

Answer: Option A
Solution:
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.