ProgrammingHardGATE CS · Campus placements

How many integers from 0 to 255 have exactly four 1 bits in binary?

  1. A. 56
  2. B. 64
  3. C. 70
  4. D. 28

Correct answer: C. 70

Choosing 4 of the 8 bit positions gives C(8,4) = 70 values, each one a different byte.

More C Programming questions

Exams that ask this topic