What is a variable?
Variable is a name given to a memory location.Variable will be having a memory address value
For eg:-
int iNum1
char cName
float fNum etc..
Here, int,char,float represents the Data type to be used and iNum1,cName,fNum are the variable names given for those DataTypes.
Rules For Declaring a Variables :-
1. A Variable name Should Start with an Alphabet.
2. Key Words representing the program should not be used as variable name.
for eg: numeric, int, console etc.. should not be used.
3. Special characters except an underscore( _ ) are not allowed.
4. Variable names should not start with a number.
No comments:
Post a Comment