Skip to main content

Bit Manipulation Quiz

Editorial

16 questions across the three Bit Manipulation lessons and the section's problems: bits, the operators and negative numbers in each language; setting, clearing and counting bits; XOR's cancelling, swaps and adding without +; and bitmasks as sets, the AND of a range and division by doubling. Pick an answer to see whether it's right and why. Nothing is saved, so you can take it again.

If one trips you up, its lesson is Introduction to Bit Manipulation, XOR Tricks or Bitmasks and Bitwise Arithmetic.

Quiz

1 / 16

Multiple choice

What do 13 & 6, 13 | 6 and 13 ^ 6 give?