Tuesday, 18 December 2012

Data Type 'int'




  • Data :-
              The values given to the program to perform various operations on it, is referred to as data.

  • Data Type 'int' :
                  The 'int' stands for integer. An integer is a whole number without decimal part. It may have a positive or a negative value. The numbers 0, 1, 2, 3, ...., and their negatives -1, -2, -3, ....., are example of integers.
                               The 'int' data type is used to store whole values. It takes 2 bytes in memory. The 'int' type variables can store values from  -32768 to 32767 (-215 to 215 -1). If a  value greater then 32767 is assigned to an 'int' type variable then correct value will not be assigned (or fit) in the memory allocated to that variable. This condition is called integer overflow. When overflow occurs, the program continues to run but it produces incorrect result.