C Programming - Control Instructions - Discussion


A short integer is at least 16 bits wide and a long integer is at least 32 bits wide.

[A]. True
[B]. False

Answer: Option A


The basic C compiler is 16 bit compiler, below are the size of it's data types
The size of short int is 2 bytes wide(16 bits).
The size of long int is 4 bytes wide(32 bits).

Shibendrakumardas said: (Jul 5, 2011)  
short integer=2 byte size

long integer=4 byte size

short integer=2*8=16 byte

long integer=4*8=32 byte

Sajal said: (Sep 13, 2011)  
Short integer can not be more than 16 bits but here the question says that it is atleast 16 bits, same argument for long.

If it has been specified that atleast that means it should be greater than or equal to 16 bits hence according to me false is the correct option!

Rupinderjit Singh said: (Oct 4, 2011)  
@sajal: here atleast intend minimum number of bits should be 16,and maximum is obviously "16".

Option A is Correct.

Moreover,It's not a "reasoning question".So don't completely rely on words given in question.As a matter of fact,maximum length of short int is 16 bits.

Same is the case for long int.

Ram said: (Jul 28, 2013)  
I have read in Balagurusamy textbook that short int is of 1 byte length i.e. 8 bits.

Chandan said: (Jun 5, 2014)  
C standard (C89, C99) says nothing about exact size of short and long integers. All it demands:

character < short int < int < long int < long long int

Implementation can implement it the way it wants and has to just comply to above ranking.

Arindam Mangal said: (Mar 19, 2016)  
Short integer consists of i.e., Short signed int is 2 bytes(16bits) and Short unsigned is 2 bytes(16bits). Maximum Short integer consists of 4 bytes(16bits+16bits=32bits). So a short integer is at least 16 bits wide which is correct.

Long integer consists of i.e., Long signed int is 4 bytes(32bits)and Long unsigned int is 4 bytes(32bits). Maximum Long integer consists of 8 bytes(32bits+32bits=64bits). So a long integer is at least 32 bits wide which is correct.

So option A is correct.

Utkarsh said: (Jun 2, 2019)  
Yes, you are correct @Chandan.

Sriman said: (Sep 12, 2021)  
Yes, you are right @Chandan.

Sriman said: (Sep 12, 2021)  
Yes, you are right @Chandan.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.