← Quiz: Bitwise Operators in C: all 15 questions
Quiz: Bitwise Operators in C · Question 3 of 15
Which expression clears bit 3 of x?
Which expression clears bit 3 of x?
- A.x | (1u << 3)
- B.x ^ (1u << 3)
- C.x & ~(1u << 3)
- D.x >> 3
Answer & explanation
Correct answer: x & ~(1u << 3)
~(1u << 3) has every bit set except bit 3; AND keeps all other bits and forces bit 3 to 0.
Can you get the rest right without peeking?
Take the timed Quiz: Bitwise Operators in C quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →