WHAT ARE CONSTANTS IN C PROGRAMMING LANGUAGE?
Constants are nothing just a fixed value that is fixed during the execution of the program.
Important things regarding Constants n C programming
- Value of Constant cannot be altered or modified.
- It can be treated as a variable.
- It can be of any basic data types in the C programming language.
DECLARATION OF CONSTANTS IN C
There are 2 ways to define constants in C Programming
The syntax of declaring constant using #define preprocessor directives.
#define Constant_Identifier Value
2. Using const keyword in the variable declaration.
The syntax of declaring constant using the const keyword.
const data_type variable_name = Constant;