Bird
0
0

Which of the following relational operators in C checks if two values are equal?

easy📝 Conceptual Q11 of 15
C - Operators and Expressions
Which of the following relational operators in C checks if two values are equal?
A!=
B==
C=
D>
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of each operator

    The operator == is used to compare two values for equality. The single = is an assignment operator, != checks inequality, and > checks if left is greater than right.
  2. Step 2: Identify the equality operator

    Since == compares two values for equality, it is the correct relational operator for this purpose.
  3. Final Answer:

    == -> Option B
  4. Quick Check:

    Equality check = == [OK]
Quick Trick: Equality uses double equals ==, not single = [OK]
Common Mistakes:
  • Confusing = (assignment) with == (equality)
  • Using != instead of ==
  • Using > instead of ==

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes