ProgrammingModerateGATE CS · Campus placements

uint32_t x = 0x00F0A8u; what is x & (0u - x) in hexadecimal?

  1. A. 0xA8
  2. B. 0x80
  3. C. 0x10
  4. D. 0x8

Correct answer: D. 0x8

0u - x is the two's-complement negation modulo 2^32. ANDing it with x isolates the lowest set bit of 0xA8, which is bit 3 with value 0x8.

More C Programming questions

Exams that ask this topic