Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How many forms of integer constants are there in C language? How do they behave?
How many forms of integer constants are there in C language? How do they behave?
In C language, integer constants are divided into decimal integer constants, octal integer constants and hexadecimal integer constants.

1, decimal integer constant

Integer constants in this format can only have numbers from 0 to 9, and can have positive and negative signs. For example:

0 1 364 28 -34

2. Octal integer constant

Integer constants in this format are octal numeric strings starting with the number 0. Where the numbers are 0 ~ 7. For example:

0 1 1 1 decimal 73, 0 1 1 decimal 9,0123 decimal 83,

3. Hexadecimal integer constant

Integer constants in this format are hexadecimal numeric strings starting with 0x or 0X(x is capitalized). Where each number can be 0 ~ 9, a ~ f or a ~

Numbers or English letters in F. For example:

0x 1 1 decimal 17, 0Xa5 decimal 165, 0x5a decimal 90,