If an integer needs two bytes of storage, then the maximum value of a signed…
2012
If an integer needs two bytes of storage, then the maximum value of a signed integer is
- A.
216 − 1
- B.
215 − 1
- C.
216
- D.
215
Attempted by 157 students.
Show answer & explanation
Correct answer: B
Two bytes equal 16 bits total. For a signed integer, one bit is reserved for the sign, leaving 15 bits to represent magnitude. Consequently, the maximum positive value is 2^15 - 1, which equals 32,767.
A video solution is available for this question — log in and enroll to watch it.