Bird
0
0

Which of the following is the correct syntax to check if variable a is not equal to variable b in C?

easy📝 Syntax Q12 of 15
C - Operators and Expressions
Which of the following is the correct syntax to check if variable a is not equal to variable b in C?
Aa !== b
Ba <> b
Ca =! b
Da != b
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct not equal operator in C

    In C, the operator for not equal is !=. Other options like <> or !== are not valid in C.
  2. Step 2: Verify the syntax correctness

    The expression a != b correctly compares if a is not equal to b.
  3. Final Answer:

    a != b -> Option D
  4. Quick Check:

    Not equal operator = != [OK]
Quick Trick: Use != for not equal in C, not <> or !== [OK]
Common Mistakes:
  • Using <> which is invalid in C
  • Writing =! instead of !=
  • Using !== which is from other languages

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes