Constant is also a value or variable,but only difference is their values cannot be change by the program once they are defined.Constant are also referd a fixed values and constants may be belonging to any of the data type.
Type of Constant :-
Real or floating-point Constant
'c program','hello world' etc.
There are two ways to define constant
Const keyword: In C const keyword are used to declare the constants with a specific typeconst type variable = value; For Example :-
const int height = 100;
printf("The value of height is :%d", height);
Now the value of height cannot be changed.
The value of height is : 100
If you change the value of height, you will get an error at the compile time.
#define Preprocessor: The #define Preprocessor directive is used to define constant substitution and #define preprocessor are use with specific type
#define identifier value
Let’s see the example of #define