ProgrammingHard

For unsigned x = 40 (binary 101000), what is x & -x?

  1. A. 40
  2. B. 8
  3. C. 16
  4. D. 1

Correct answer: B. 8

The expression isolates the lowest set bit, which is bit 3 with value 8. Unsigned negation wraps modulo 2^32.

More C Programming questions

Exams that ask this topic