C Programming - Control Instructions - Discussion

Discussion Forum : Control Instructions - True / False Questions (Q.No. 1)
A short integer is at least 16 bits wide and a long integer is at least 32 bits wide.
Answer: Option

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).

9 comments Page 1 of 1.

Sriman said:   3 years ago
Yes, you are right @Chandan.

Sriman said:   3 years ago
Yes, you are right @Chandan.

Utkarsh said:   5 years ago
Yes, you are correct @Chandan.

Arindam Mangal said:   8 years ago
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.

Chandan said:   10 years ago
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.

Ram said:   1 decade ago
I have read in Balagurusamy textbook that short int is of 1 byte length i.e. 8 bits.

Rupinderjit Singh said:   1 decade ago
@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.

Sajal said:   1 decade ago
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!

Shibendrakumardas said:   1 decade ago
short integer=2 byte size

long integer=4 byte size

short integer=2*8=16 byte

long integer=4*8=32 byte

Post your comments here:

Your comments will be displayed after verification.