ProgrammingHard

unsigned int x = 0b11011010; printf("%u", (x >> 3) & 7); What is printed?

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

Correct answer: B. 3

x >> 3 is 0b11011 = 27, and 27 & 7 keeps the low three bits, which are 011 = 3.

More C Programming questions

Exams that ask this topic