Q.7 Write the naming rules variable.
Answers
Answered by
0
Answer:
Rules for naming a variable
A variable name can only have letters (both uppercase and lowercase letters), digits and underscore.
The first letter of a variable should be either a letter or an underscore.
There is no rule on how long a variable name (identifier) can be.
Answered by
9
Answer:
Variables
VariablesIn programming, a variable is a container (storage area) to hold data.
VariablesIn programming, a variable is a container (storage area) to hold data.To indicate the storage area, each variable should be given a unique name (identifier). Variable names are just the symbolic representation of a memory location.
Rules for naming a variable
- A variable name can only have letters (both uppercase and lowercase letters), digits and underscore.
- A variable name can only have letters (both uppercase and lowercase letters), digits and underscore.The first letter of a variable should be either a letter or an underscore.
- A variable name can only have letters (both uppercase and lowercase letters), digits and underscore.The first letter of a variable should be either a letter or an underscore.There is no rule on how long a variable name (identifier) can be. However, you may run into problems in some compilers if the variable name is longer than 31 characters.
Similar questions