Variables in c

variables are used as memory locations to store values. the value may change during execution of the programme so this is called variable. the variables are the name given to the identity .so variables are also called as identifiers .when we create a variable, we reserve some space in the memory.below are some rules for variables

  • the first character should be alphabet or underscore
  • succeeding characters can be digits or alphabets
  • Uppercase and lowercase identifiers are different
  • keywords are not used as identifiers
  • now two successive underscores are allowed
  • no special characters or symbols are allowed except underscore

syntax:

datatype variable1, variable2…;

example:

int x=213,y=21,z;
float u=124.14;
char c='d';