Let us get to new topic which deals with the integer constants . What are integers ? Integer constants do not contain decimal points. Variables can be declared as integers in the following ways :
int x,y;
short int x,y;
long int x,y;
In the first statement , the variables x and y take integer values. In the second statement x, y are of the short type.The third statement declares x,y as long integer type variables.
(i) Integer data : The keyword ‘int’ stands for the integer data type in C++ and its size 16 or 32 bits. A 16 bit integer may fall in the range of -2^15 to 2^15 – 1. While 32 bit integers may fall in the range of -2^31 to 2^31 – 1.
(ii) Short integer data type: Normally ‘short int’ is used to declare the short integer data type in c++ whose maximum size is 16 bits long. It may fall in the range of -32768 to 32767 or -2^15 to 2^15 -1.
(iii) Long integer data type : Usually, the ‘long int’ stands for long integer data type used in C++ and its size is 32 bits. It may fall in the range of -2147483648 to 2147483647 or -2^31 to 2^31 – 1. The long integer is identified by an ‘L’ or ‘l’.
Thank you for the patience reading I will return soon to you for the further discussion……. Good bye………..
Saturday, June 21
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment