C++ program for printing the range data type like int, char, short.
Signed Data Types
METHOD
1.) calculate total number of bits by multiplying sizeof with 8 (say n)
2.) Calculate -2^(n-1) for minimum range
3.) Calculate (2^(n-1))-1 for maximum range
Output:
signed char: -128 to 127
signed int: -2147483648 to 2147483647
signed short int: -32768 to 32767
Unsigned Data Types
METHOD
1.)Find number of bits by multiplying result of sizeof with 8 say n
2.)minimum range is always zero for unsigned data type
3.)for maximum range calculate 2^n-1