Constants in C Programming

If you want to define a variable whose value cannot be changed, you can use the const keyword. This will create a constant. For example,
const double PI = 3.14;

Notice, we have added keyword const.

Here, PI is a symbolic constant; its value cannot be changed.

const double PI = 3.14;
PI = 2.9; //Error

Comments

Popular posts from this blog

Keywords in C Programming

Definition of C Language

Data Types in C Programming