ProgrammingHard

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

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

Correct answer: A. 6

3 ^ 5 = 6, and 6 & ~1 clears bit 0, which is already 0, so the result is 6.

More C Programming questions

Exams that ask this topic