ProgrammingHardTCS NQT · Infosys

printf("%d %d", 1 < 2 < 3, 3 > 2 > 1); What is printed?

  1. A. 1 0
  2. B. 1 1
  3. C. 0 1
  4. D. 0 0

Correct answer: A. 1 0

Relational operators associate left to right: (1 < 2) < 3 is 1 < 3, which is 1, and (3 > 2) > 1 is 1 > 1, which is 0.

More C Programming questions

Exams that ask this topic