AsegGasiaBlog

C Programming - Variables And Constants - Constants

 Constants

A constant is an identifier with an associated value which cannot be altered by the program during execution.

How to declare constant variable ?

We can declare constant variable using const keyword.

Example of declaring constant variable



//Syntax for declaring constant variable
data type const variable_name = value;

//float constant
float const pi = 3.14;

//integer constant
int const a = 5;

//character constant
char const yes = 'y';

Popular Posts