An entity that may vary during program execution is called a ‘Variable’. Variables names are names given to locations in memory. These locations can contain integer, real or character constants. In any language, the types of variables that it can support depends on the types of constants that it can handle. Variable names are just symbolic representation of the memory location. For Example :
Here, num is the variable of integer type.
Rules for Constructing variable Names in C :
- A variable name is any combination of 1 to 31 alphabets, digits or underscore (_).
- The first character in the variable name must be an alphabet or underscore.
- No commas and blanks are allowed within a variable name.
- No special symbol except underscore can be used in a variable name.
In C Programming, you have to declare the variable before using it in the program.