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

  1. A.

    216 − 1

  2. B.

    215 − 1

  3. C.

    216

  4. 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.

Explore the full course: Mppsc Assistant Professor