ProgrammingHard

How many integers in the range 0 to 255 have both bit 7 and bit 0 set?

  1. A. 32
  2. B. 64
  3. C. 128
  4. D. 127

Correct answer: B. 64

Bit 7 and bit 0 are fixed to 1, and the other six bits are free, which gives 2^6 = 64 values.

More C Programming questions

Exams that ask this topic