ProgrammingHardGATE CS · Campus placements

How many leading zero bits does the 16-bit unsigned value 0x0100 have?

  1. A. 7
  2. B. 8
  3. C. 23
  4. D. 4

Correct answer: A. 7

0x0100 = 0000 0001 0000 0000 has its top set bit at index 8, so 15 - 8 = 7 zeros precede it. 8 confuses the bit index with the count, 23 counts in a 32-bit width, and 4 counts only the leading zero hex digit.

More C Programming questions

Exams that ask this topic