Constants in 'C'

As the name suggests the name constants are given to such variables or values in C/C++ programming language which cannot be modified once they are defined. They are fixed values in a program. There can be any types of constants like integer, float, octal, hexadecimal, character constants, etc. Every constant has some range. The integers that are too big to fit into an int will be taken as long. Now there are various ranges that differ from unsigned to signed bits. Under the signed bit, the range of an int varies from -128 to +127, and under the unsigned bit, int varies from 0 to 255. 

Defining Constants: 
In C/C++ program we can define constants in two ways as shown below: 
 

1. Using #define preprocessor directive
2. Using a const keyword
Posted on by