Variable In C Programming With Rules & Examples Example
Get Our Latest Interview Questions: Aptitude, Reasoning, English, GD, HR-PI
Variable:
We used lots of time a keyword ”Variable”. What is variable:
Variable is a data name, that used to store the data value.
Variable Ex:
int a=2, b=3;
Here int is data type you read in previous page, and a & b are called as variables. Which is used to store the value. Here a variable is storing 2 and b variable is storing 3.
Rules For Creating or Defining a Variables:
1. It must begin with a letter.
2. Length of the variable should not be normally more than 8 characters but some standard of c also
recognize a length of 31 character.
3. Upper case and lower case letter are different (significant).
For Ex: if we write a variable name COST and cost, then c takes both as different letter because c
already allotted some value to all alphanumeric values. So it take different value for C and c.
4. The variable name should not be a keyword. Blank Space or White space is not allowed.
Example Of Variable: a, ab, cad,sasa, ins12, abs_2, as@2a;
Expert Review: Variable name is like giving name to new born child so that we identify by name.