ProgrammingModerate
What is the parity of the number of set bits in 0b1011, so that the result is 1 when odd?
- A. 1
- B. 0
- C. 2
- D. 3
Correct answer: A. 1
0b1011 has three set bits, which is odd, so the parity bit is 1.
More C Programming questions
- What is the value of 2 + 3 << 1 & 7 in C?
- What is the value of 5 ^ 3 & 1 in C?
- unsigned int u = 1; int s = -2; printf("%u", u + s); What is printed with 32-bit unsigned int?
- With int a = -1 and unsigned int b = 0, what does the expression a < b evaluate to?
- Using the extended Euclidean algorithm, what is the inverse of 10 modulo 17?
- What is the number of 1 bits in 0xF0F0 (a 16-bit value)?