In C programming language, a constant is a value that cannot be modified during the execution of the program. Constants are often used to define fixed values that are used repeatedly throughout a program.
Here are some examples of constants in C:
Integer Constants: Integer constants are whole numbers without any decimal point or fractional part. They can be represented in decimal, octal or hexadecimal formats. Examples of integer constants in C include:
Floating Point Constants: Floating point constants are real numbers with a decimal point or an exponent. They can be represented in decimal or exponential formats. Examples of floating point constants in C include
Character Constants: Character constants are single characters enclosed in single quotes. Examples of character constants in C include:
String Constants: String constants are a sequence of characters enclosed in double quotes. Examples of string constants in C include:
Enumeration Constants: Enumeration constants are user-defined constants that represent a set of named values. Examples of enumeration constants in C include:
Note that in C, constants are usually defined using the const keyword to indicate that their values cannot be changed.