Variables are run time entities and these are used to hold temporary data at program run time.
In C, Every variable declare with a predefined data type.
RULES FOR NAMING VARIABLE
RULE 1: Variable name cannot declare with a reserved keyword.
EXAMPLES
int void (wrong declaration)
int void1 (correct declaration)
RULE 2: Variable does not contain any blank space.
EXAMPLES
int a bc (wrong declaration)
int a_bc (Correct declaration)
RULE 3: Variable name should not start with a number.
EXAMPLES
int 2abc (wrong declaration)
int a123 (correct declaration)
RULE 4: Two variables cannot declare with same name.
EXAMPLES
int a, a; (wrong declaration)
int a, b; (Correct declaration)
No comments:
Post a Comment