ProgrammingVery hard

What is the value of 5 ^ 3 & 1 in C?

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

Correct answer: C. 4

& binds tighter than ^, so 3 & 1 = 1 is computed first, and then 5 ^ 1 = 4.

More C Programming questions

Exams that ask this topic