Translate

Labels

Saturday 29 December 2012

INTEGER CONSTANT

An integer constant is a decimal number (base 10) that represents an integer value (the whole 
number ).It comprises of the digits 0 to 9.If an integer constant begins with the letter 0x or 0X, it is 
a hexadecimal(base 16) constant.If it begins with 0 then it is an octal (base 8) constant. Otherwise 
it is assumed to be decimal.

  • 64, 73,and 387 are decimal constants 
  • 0x1C, 0xAB, and 0x23 are hexadecimal constants 
  • 032, 065, 064 are octal constants


Integer constants are positive unless they are preceded by a minus sign and hence -16 is also a 
valid integer constant.Special characters are not allowed in an integer constants.The constants 
2,654 is an invalid integer constant because it contains the special character.

No comments: