A variable is a name given to a memory location where the data can be stored. Using the variable name, the data can be stored in memory location and can be accessed or manipulated very easily
Variable in C Programming is also called as container to store the data. Variable name may have different data types to identify the type of value stored. Suppose, we declare variable of type integer then it can store only integer values.
Variable is considered as one of the building block of C Programming which is also called as identifier.
Rules for defining a variable:-
The first character in the variable should be a letter (from a to z or A to Z) or an underscore.
The first character can be followed by any number of letters or digits( 0 to 9) or underscores.
No extra symbols are allowed other than letters, digits, and underscore.
C keywords should not be used as variable names.
Defining a variable :-
Defining a variable means the compiler has to now assign a storage to the variable because it will be used in the program.
Syntax:- data-type variable name; Example:- int a;
Initialization of a Variable
Syntax :- Data types Variable Name = data ; Example:- int a=5;