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

Quiz: Data Representation · Question 7 of 9

What does this print? (code)

What does this print?

print(format(-12 & 0xFF, "08b"))
  1. A.10001100
  2. B.11110011
  3. C.11110100
  4. D.00001100
Answer & explanation

Correct answer: 11110100

12 = 00001100; invert to 11110011 and add 1 to get 11110100.

Can you get the rest right without peeking?

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

Start the quiz →