ProgrammingHard

What is the total number of 1 bits in the binary representations of the integers 1 through 10?

  1. A. 17
  2. B. 15
  3. C. 19
  4. D. 10

Correct answer: A. 17

The counts are 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, which total 17.

More C Programming questions

Exams that ask this topic