ProgrammingModerateTCS NQT · Wipro

What is the range of values of a signed 8-bit two's-complement integer?

  1. A. -127 to 127
  2. B. -128 to 128
  3. C. -128 to 127
  4. D. 0 to 255

Correct answer: C. -128 to 127

8 bits give 256 patterns. Two's complement assigns one more pattern to the negatives because zero takes a non-negative slot: −2^7 to 2^7 − 1. '−127 to 127' is the sign-magnitude or ones'-complement range.

More C Programming questions

Exams that ask this topic