ProgrammingVery hardJEE Main · CAT placement

What is printed?

What is printed?
x = 0xDEAD
print(x >> 8 & 0xFF, (x >> 8) & 0xF, hex(x & -x))
  1. A. 222 14 0x1
  2. B. 222 14 0x0
  3. C. 222 15 0x1
  4. D. 221 14 0x1

Correct answer: A. 222 14 0x1

Shifting 0xDEAD right by 8 gives 0xDE, which is 222. The low nibble of 0xDE is E, which is 14. x is odd, so its lowest set bit is 1, and x & -x is 1.

More Python Programming questions

Exams that ask this topic