Integer Constants
An integer constant refers to a sequence of digits. There are three categories of integers that are namely, decimal, octal and hexadecimal.
Decimal integers consist of a set of digits from 0 to 9. The decimal integers can be positive or negative.
Example:
1234
0
+456
-4238
Octal integers will consist of some combination of digits from 0 to 7, with a leading zero.
Example:
089
0456
0
0555
Hexadecimal integers consist of a sequence of digits 0 to 9 and alphabets from A (a) to F (f). These integers are preceded through 0x or 0X. The letters 'A' (a) to 'F ' (f) represent the integers 10 to 15.
Example:
0X3
0XBC
0x76f
The largest integer value which can be stored is machine dependent. That is 32767 on 16- bit machine and 2,147,483,647 on the 32_bit machine. It is also possible to store large integer constants on these machines through appending modifiers like as U, L, UL to the constants.
Example:
23456U(u) unsigned integer
987654321UL(ul) unsigned long integer
928374L(l) long integer