🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: COA Numericals: all 10 questions

Quiz: COA Numericals · Question 8 of 10

What does this print? (code)

What does this print?

import struct
print(hex(struct.unpack(">I", struct.pack(">f", -12.5))[0]))
  1. A.0x41480000
  2. B.0xc1480000
  3. C.0xc1280000
  4. D.0x41c80000
Answer & explanation

Correct answer: 0xc1480000

Only the sign bit changes from +12.5, so 0x41480000 becomes 0xc1480000.

Can you get the rest right without peeking?

Take the timed Quiz: COA Numericals quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →