ProgrammingHardGATE CS · Campus placements

What is (uint32_t)~0u >> 28?

  1. A. 16
  2. B. 255
  3. C. 7
  4. D. 15

Correct answer: D. 15

All 32 bits are set, and shifting right by 28 leaves the top four bits, which is 0xF = 15. The conversion to uint32_t keeps the width fixed.

More C Programming questions

Exams that ask this topic