🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.x | (1u << 3)
  2. B.x ^ (1u << 3)
  3. C.x & ~(1u << 3)
  4. 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 →