A variable is a value that can change any time. It is a memory location used to store a data value. A variable name should be care fully chosen by the programmer so that it use is reflected in a useful way in entire program. Variable names are case sensitive.
Example of variable names are
sun
Number
Salary
Emp_name
Average1
Any variable declared in a program should confirm to the following-
1. They must always begin with a letter, although some systems permit underscore as first character.
2. The length of a variable must not be more than 8 characters.
3. White space is not allowed and
4. A variable should not be a keyword
5. It should not contain any special characters.
Example of invalid names are
123
(area)
6th
%abc
Example of variable names are
sun
Number
Salary
Emp_name
Average1
Any variable declared in a program should confirm to the following-
1. They must always begin with a letter, although some systems permit underscore as first character.
2. The length of a variable must not be more than 8 characters.
3. White space is not allowed and
4. A variable should not be a keyword
5. It should not contain any special characters.
Example of invalid names are
123
(area)
6th
%abc
0 Comments:
Post a Comment