].
Q21.
Why do unsigned integers take values from 0 to 65,535?
[Hint:
We know that an unsigned modifier can be used to increase the accuracy of a variable.
This is because the leftmost bit is no longer needed to store the sign of the number, since we are
only dealing with positive integers. This
extra bit
is used to increase the magnitude of the value
stored in that variable by a factor of 2. Please note that n bits can now be used to store values up
to 2
n
–1. Also note that on a machine that stores integers in 16 bits, this means that unsigned
integers can range in value from 0 through 65,535.
].
S
CHAPTER
3
A
RRAYS AND
P
OINTERS
Do'stlaringiz bilan baham: |