Explain what are the Sizes and ranges of the Basic C++ data types?

Submitted by: Administrator
Following table is with respect to a 16-bit word machine:

Type Bytes Range
char 1 -128 to 127
unsigned char 1 0 to 255
signed char 1 -128 to 127
int 2 -32768 to 32767
unsigned int 2 0 to 65535
signed int 2 2 -32768 to 32767
short int 2 2 -32768 to 32767
unsigned short int 2 0 to 65535
signed short int 2 -32768 to 32767
long int 4 4 -2147483648 to 2147483647
signed long int 4 -2147483648 to 2147483647
unsigned long int 4 0 to 4294967295
float 4 4 3.4E-38 to 3.4E+38
double 8 8 1.7E-308 to 1.7E+308
long double 10 3.4E-4932 to 1.1E+4932
Submitted by: Administrator

Read Online C++ Syntax Job Interview Questions And Answers