ProgrammingVery hardJEE Main · CAT placement
What is printed?
What is printed?
x = 0xDEAD print(x >> 8 & 0xFF, (x >> 8) & 0xF, hex(x & -x))
- A. 222 14 0x1
- B. 222 14 0x0
- C. 222 15 0x1
- 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
- What is printed? python print(sorted([-3, 2, -1, 4], key=lambda v: (abs(v) % 3, v)))
- What is printed? python print(f'{1234.5:,.2f}', f'{0.000123:.2e}', f'{-0.0:+.1f}', f'{0x123456:x}')
- What is printed? python print(int('٠٠٢٩') + 1, '٢٩'.isdigit())
- What is printed? python s = 'abc' print(s 0 == '', s[::-1][::-1] == s, s[1:-1] 2, s[-3:-1])
- What is printed? python print(sorted(['x10', 'x9', 'x1'], key=lambda s: int(s[1:])))
- What is printed? python print(0.1 3 == 0.3, 0.1 3 == 3 0.1, round(0.1 3, 1) == 0.3, 1 - 0.9 == 0.1)