A
variable is a name of the memory location in the programs and it is used to
hold the data or value. Variable name is given by the programmer in the
programs.
Variable can store any type of value according to its data type. For
example a integer variable can store integer value, float variable store real
value and character variable is store characters.
There
are some rules for creating a variable:
- They must begin with alphabet or underscore.
- Length of the variable is 63 characters long.
- Upper case and lower case variable names are different from each other. for example sum is not same as SUM or Sum.
- It should not be a keyword.
- Blank space and comma is not allowed here.
- No special symbol other than an underscore can be used in a variable name.
Syntax:
data_type variable_name;
Ex:
int jai, rana;
float total;
char ch;
No comments:
Post a Comment