ProgrammingHard

In a 32-bit unsigned int, what is (~0u) >> 28?

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

Correct answer: A. 15

~0u is all 32 bits set. Shifting right by 28 leaves the top four bits, all set, which is 15.

More C Programming questions

Exams that ask this topic