Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

All of these hold signed integers. In addition, each of these have unsigned coun

ID: 3878219 • Letter: A

Question

All of these hold signed integers. In addition, each of these have unsigned counterparts. So for example, all of the following are legal C statements: int v; // 32-bit signed integer, like Java byte wi // 8-bit signed integer unsigned short x; // 16-bit unsigned integer unsigned int y; // 32-bit unsigned integer long z; // 64-bit signed integer You have already computed the highest and lowest possible values for the 32-bit signed integer (v). What are the highest and lowest possible Base 10 values that can be stored in each of the other C variables? You can express your answers as powers of 2, once you see the patterns. Variable byte w; unsigned short x; unsigned int y; long z; Lowest Highest

Explanation / Answer

ANSWER :

Variable

Lowest

Highest

byte w;

-128(-27)

127(27-1)

unsigned short x;

0

65535(216-1)

unsigned int y;

0

4,294,967,295(232-1)

long z;

-9,223,372,036,854,775,808(-263)

9,223,372,036,854,775,80(263-1)

Variable

Lowest

Highest

byte w;

-128(-27)

127(27-1)

unsigned short x;

0

65535(216-1)

unsigned int y;

0

4,294,967,295(232-1)

long z;

-9,223,372,036,854,775,808(-263)

9,223,372,036,854,775,80(263-1)