🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Bitwise Operators in C: all 15 questions

Quiz: Bitwise Operators in C · Question 2 of 15

What is the value of ~7 on a two's complement machine?

What is the value of ~7 on a two's complement machine?

  1. A.7
  2. B.-7
  3. C.-8
  4. D.0
Answer & explanation

Correct answer: -8

~x is -x - 1, so ~7 = -8.

Can you get the rest right without peeking?

Take the timed Quiz: Bitwise Operators in C quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →