← 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?
- A.7
- B.-7
- C.-8
- 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 →