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 carefully chosen by the programmer so that its use is reflected in a useful way in the 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 the 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.
Examples of Invalid Variable names are
123
(area)
6th
%abc
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment