ProgrammingVery hard

printf("%d", ((1u << 4) - 1) ^ 0xF); What is printed?

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

Correct answer: C. 0

The subtraction binds tighter than ^, so (16 - 1) ^ 15 = 15 ^ 15 = 0.

More C Programming questions

Exams that ask this topic