Variables and Data Types In C Programming Language

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 –

  1. It must start with a letter(a-z/A-Z) or underscore(_).
  2. NO commas(,) or any special character(!,@,#,$) is allowed except underscore(_).
  3. It can only be a combination of letters, numbers and underscore.
  4. It should not contain white spaces.
  5. 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

Leave a Reply

Your email address will not be published. Required fields are marked *