🎙 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 13 of 15

What does (x k) & 1 give?

What does (x >> k) & 1 give?

  1. A.x divided by k
  2. B.The value (0 or 1) of bit k of x
  3. C.x with bit k set
  4. D.The number of set bits in x
Answer & explanation

Correct answer: The value (0 or 1) of bit k of x

Shifting right by k brings bit k to position 0, and & 1 keeps only that bit.

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 →