If an integer needs two bytes of storage, then the maximum value of unsigned…
2011
If an integer needs two bytes of storage, then the maximum value of unsigned integer is
- A.
2¹⁶ − 1
- B.
2¹⁵ − 1
- C.
2¹⁶
- D.
2¹⁵
Attempted by 155 students.
Show answer & explanation
Correct answer: A
Since one byte consists of eight bits, two bytes provide a total storage capacity of exactly sixteen bits for data representation. For an unsigned integer utilizing n bits, the maximum representable value is mathematically calculated as two to the power of n minus one. Therefore, with sixteen bits available for storage in this scenario, the maximum value is 2¹⁶ − 1.
A video solution is available for this question — log in and enroll to watch it.