What is the 16-bit compiler allowable range for integer constants?

What is the 16-bit compiler allowable range for integer constants?

a) -3.4e38 to 3.4e38
b) -32768 to 32767
c) -2147483648 to 2147483647
d) -128 to 127

Answer:

b) -32768 to 32767

Explanation:

On a 16-bit compiler, the allowable range for int data type (which typically takes 2 bytes) is -32768 to 32767. This range is based on the number of bits available for storing the integer, with one bit reserved for the sign. Understanding the range of integer constants is important for ensuring that your program handles numeric values correctly and avoids overflow or underflow errors.

Reference links:

https://www.rameshfadatare.com/learn-c-programming/

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top