- Integer constants: Integer constants can be numbers in decimal, octal, hexadecimal, or binary format, such as 10, 012, 0x1A, 0b1010, etc.
- Floating point constants are numbers that include a decimal point, such as 3.14 and -0.23.
- Character constants: Character constants are enclosed in single quotes, such as ‘A’, ‘b’, ‘1’, etc.
- String constants: Strings are enclosed in double quotation marks, for example “Hello, World”.
- Symbolic constants: Symbolic constants are defined using the #define directive, for example #define PI 3.14159.
- Enumerate constants: Constants are defined using the enum keyword, for example enum color {RED, GREEN, BLUE}.
- Macro definition constants: Constants defined using the #define directive are also known as macro definition constants, for example #define MAX 100.
- Other constants: There are also some special constants, such as NULL representing a null pointer constant, true and false representing true and false.
✖