What is Keyword in C programming language?

In C programming language a predefined set of reserved words which provide computed control of various functions and declares in C compiler pre-processing libraries which perform special functions. The basic instructions are built up using a reserved set of words, for example main, for, if, else, switch, while, default, double, extern, for, and int, etc., Programming language C demands that they are used only for giving commands or making statements. Programmer cannot use default, for example, as the name of a variable. An attempt to do so will result in a compilation error.

In formal keywords are standard forms of identifiers that have standard predefined meaning in C compiler. Keywords are all lowercase, since uppercase and lowercase characters are not equivalent because C programming supports Case sensitivity, So it’s possible to utilize an uppercase keyword as an identifier but it’s not a good programming practice.

Note:

  1. Keywords are the words whose meaning has already been explained to the C compiler and their meanings cannot be changed. Hence keywords are also called ‘Reserved words’.
  2. Keywords can be used only for their intended purpose.
  3. Keywords serve as basic building blocks for program statements.
  4. Keywords can’t be used as programmer defined identifier.
  5. The keywords can’t be used as names for variables.
  6. All keywords must be written in lowercase.
  7. 32 keywords available in C.

Rules and Restrictions apply to keywords in C Programming Languages:

There have some predefined rules and restrictions that are followed by the developers about to initialize and used the keywords in C programming languages;

  • Keywords are the words whose meaning has already been explained to the C compiler and their meanings cannot be changed.
  • Keywords can be used only for their intended purpose.
  • Keywords cannot be used as developer variables.
  • All keywords must be written in lowercase.

List of standard keyword in C programming language :

Data typesQualifiers  User-definedStorage ClassesLoopDecisionJumpDerivedfunctionOther
 
intsignedenumexternforifgotostructvoidconst
charunsigned registerwhileelsecontinueunionreturnvolatile
floatshort staticdoswitchbreak  sizeof
doublelong  auto case    
default

Brief introduction of standard keywords and their specification:

Data type Keywords:

intSpecifies the integer type of value a variable will hold
charSpecifies the character type of value a variable will hold
floatSpecifies the single-precision floating-point of value a variable will hold
doubleSpecifies the double-precision floating-point type of value a variable will

 

Qualifier Keywords:

signed   Specifies a variable can hold positive and negative integer type of data
unsignedSpecifies a variable can hold only the positive integer type of data
shortSpecifies a variable can hold fairly small integer type of data
longSpecifies a variable can hold fairly large integer type of data

 

Loop Control Structure Keywords

forLoop is used when the number of passes is known in advance
whileLoop is used when the number of passes is not known in advance
doLoop is used to handle menu-driven programs

 

User-defined type Keywords

typedefUsed to define a new name for an existing data type
enumGives an opportunity to invent own data type and define what values the variable of this data type can take

 

Jumping Control Keywords

breakUsed to force immediate termination of a loop, bypassing the conditional expression and any remaining code in the body of the loop
continueUsed to take the control to the beginning of the loop bypassing the statements inside the loop
gotoUsed to take the control to required place in the program

LEAVE A REPLY

Please enter your comment!
Please enter your name here