Quiz: Bit Tricks

Test your understanding

Check Your Understanding

How do you check if nn is a power of two using bit manipulation?

  1. A.n%2==0n \% 2 == 0
  2. B.n>0n > 0 and n&(n1)==0n \& (n-1) == 0
  3. C.n&1==0n \& 1 == 0
  4. D.n==n>>1<<1n == n >> 1 << 1
Start the roadmap to answer the quizzes and solve the challenges