Keywords and Identifiers in C

Every C word is classified as either as keyword or an identifier.

Keywords :

keywords are reserved words that have predefined standard meaning in C i.e., the meaning is already defined.

  • Keywords can not be used as identifiers.
  • Keywords depends on th compiler used for compiling the program.
  • All keywords must be written in lowercase letters.
  • The meanings of the keywords cannot be changed.
  • Keywords server as basic building blocks for program statements.
  • In ANSI C, there are 32 keywords.

Examples :


 int a = 20; //Here int is a keyword. 
 while(i < 10); //Here while is a keyword. 

Following are some of the standard keywords.

Keywords and Identifiers in C

Identifiers :

Identifiers refer to the names of variables, functions and arrays, which are defined by the users.

Rules for Identifiers :

  1. Identifiers consist of a sequence of letters or alphabets(a to z or A to Z), digits (0 to 9) or underscore(_)
  2. No special symbols are allowed except underscore.
  3. The first character always must be an alphabet or underscore, but it should not be a digit.
  4. Both uppercase and lowercase letters are permitted.
  5. Length of an identifier depends on he version and the computer used.
  6. Identifier length is up to 8 characters for 16 bit machine and up to 31 characters for 32 bit machine.
  7. No two successive undercovers are allowed.
  8. Keywords cannot be used as identifiers.
  9. Mo commas or blanks are allowed with in variable name.
    Valid Identifiers : volume, y12, _sum, pop_e_89.
    Invalid Identifers : 2abc, reg.no, "z", pop_ _e89, 3rd

Post a Comment

0 Comments