ProgrammingModerate

What is the parity of the number of set bits in 0b1011, so that the result is 1 when odd?

  1. A. 1
  2. B. 0
  3. C. 2
  4. D. 3

Correct answer: A. 1

0b1011 has three set bits, which is odd, so the parity bit is 1.

More C Programming questions

Exams that ask this topic