Thursday, 6 August 2015

Constants, Variables and Keywords in C Language

Constants, Variables and Keywords in C Language:-

Constants:

A constant is an entity that does not change whereas a variable is an entity that may change. 
E.g.
a=90;
b=87;
here 90 and 87 are not  change at run time .

Variable:

A variable is name of memory Locations .These memory can contain integer, real or character constants.
like:
int nm1;      It is hold only integer constant value.
float nm2;   It is hold only float constant value.
char nm3;   It is hold only character constant value.

nm(1,2,3) is a variable name or location name. 

Rules Of constructing Variable: 

(1) Variable name can not be start from numeric and can not be numeric.
(2) Variable name can not accept any special character excluding underscore.
(3) Variable name can not be more then 32 character.
(4) Variable name can not accept blank space.

Keywords:

Key Words are reserved word that's meaning define in the system or compiler.
E.g.
auto  double  int  struct  break  else  long  switch    case  enum  register  typedef   char  extern  return union  const  float  short  unsigned   continue  for  signed  void   default  goto  sizeof  volatile do  if  static  while
  

No comments:

Post a Comment