Constant (programming)
A constant in a computer program is a value that can not be changed during the term of the program. The counterpart to this is a variable. Constants usually have semantic identifiers, which simplifies the handling and to prevent confusion with other constants. The term is however also used for literals ( literal constant ), which have no semantic identifiers. Therefore, it is clear to speak of symbolic constants with user-definable constants.
By defining constants code repetition can be avoided.
In the C language constants can be defined as a macro preprocessor.
Example
Example in the programming language BASIC: