Variables:
A quantity whose value may change during execution of the program is called variable.It is represented by a symbol or a name
Rules for writing variable names:
The following are the rules for writing a variable name in a program in c++:
A quantity whose value may change during execution of the program is called variable.It is represented by a symbol or a name
Rules for writing variable names:
The following are the rules for writing a variable name in a program in c++:
- The first character of variable name must be an alphabetic character.
- Underscore can be used as first character of variable name.
- Blank spaces are not allowed in a variable name.
- Special character, such as arithmetic operators,#,^,cannot be used in a variable name.
- Reserved words cannot be used as variable names.
- The maximum length of a variable name depends upon the compiler of c++.
- A Variable name declared for one data-type cannot be used to declare another data-type.
Example:
variables 'Pay' and 'pay' are two different variables.
Comments
Post a Comment