Constants in c are like normal variables.but difference is only that the values of variables can be changed but values of constants cannot be changed by program.Constants can be of any datatype.Constants are also known as literals.Let us see syntax.
SYNTAX:
const data_type name_of_variable;
EXAMPLES:
const int x=1; //for constant put const in front
const char alphabet="A";
const float pi=3.14;
const long x=2569874;
SYNTAX:
const data_type name_of_variable;
EXAMPLES:
const int x=1; //for constant put const in front
const char alphabet="A";
const float pi=3.14;
const long x=2569874;