Variable declaration:
Syn: datatype variable;
Syn: datatype variable=value;
Syn: datatype variable1, variable2, variable3,…;
When we declare any variable, it should be assigned to a value before its usage.Otherwise, it causes a compile time error.
Syn: datatype variable;
Ex: int x;
Variable declaration along with initialization:Syn: datatype variable=value;
Ex: int x=10;
Multiple Variable declaration:Syn: datatype variable1, variable2, variable3,…;
Ex: int x,y,z;
Note:When we declare any variable, it should be assigned to a value before its usage.Otherwise, it causes a compile time error.