Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Constant variable

If we declare a variable as const, we cannot change its value. A const variable must be assigned a value
at the time of its declaration. Once initialized, if we try to change its value, then we will get compilation
error. But this is not the case in “C Programming language”.

Example

int main()
{

const int a=10;

a=15; //give compilation error

return 0;

You might also like