In this programming language tutorial, we are going to have a look at Constants In C Programming Language and few important aspects of Constants.
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;