Constants in C
Constants in C Constants are fixed values, which do not change during the execution of a program. C supports several types of constants, which are as shown below: Contents [ hide ] 1 Integer Constants 2 Real Constants 3 Single Character Constants 4 String Literals or String Constants 5 Escape Sequences Integer Constants An integer constant refers to a sequence of digits. Generally in programs, the number systems used are: decimal, octal and hexadecimal. Decimal integers consists of umbers from 0 to 9, preceded by an optional + or – sign. Some valid examples of decimal integer constants are: 133, +45, -15, 0, 342332 etc. Embedded spaces and non-digit characters are cannot be used between digits. An octal integer consists of numbers from 0 to 7. Octal integer numbers are always preceded by a zero. For example if we have to represent 35 in octal system, we must write it as 035 in the program. Some valid examples of octal integer constants are: 035, 02, 0435, +025 etc.