In simple words Variable is a name given to a memory area where we can store data. Using that name we can access and manipulate the data. While naming a variable you keep in mind certain rules that are listed below –
- It must start with a letter(a-z/A-Z) or underscore(_).
- NO commas(,) or any special character(!,@,#,$) is allowed except underscore(_).
- It can only be a combination of letters, numbers and underscore.
- It should not contain white spaces.
- Keyword cannot be considered as valid name.
Invalid Names – 1abc, a1 bc, a@bc, else, a!bc
Valid Names – abc, ABC, aBC, _abc, _a1bc
Data Types
- Basic Data Types – int, float, char, double,
- Derived Data Types -array, structure, union, pointer
- Enumeration Data Types – enum
- Void Data Type – void