ProgrammingHard

printf("%d", 1 << 3 == 8); What is printed?

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

Correct answer: C. 1

The shift binds tighter than ==, so 1 << 3 is 8, which equals 8, giving 1.

More C Programming questions

Exams that ask this topic