...

/

Constants

Constants

Learn about different types of constants in C.

Constants are values that do not change after they have been defined. These values can be of different types.

Numeric constants

An example of an int constant is the number 1234. An example of a floating-point constant (by default typed as a double) is 123.4. Another example of a floating-point constant is 2e-3 (which represents 2 x 10310^{-3} in scientific notation). We can also write numbers in octal or hexadecimal representations instead of decimal: octal by using a leading zero (0) and ...