Rules For Defining Variables And Some Keywords In C

Rules For Defining Variables And Some Keywords In C

Rules For Defining Variables And Some Keywords In C
Let’s see some of the rules that we must follow while coding C Language and let’s also go through some of the keywords that we must know to follow the rules properly.

  1. Characters allowed : Underscore(_), Capital Letters ( A – Z ), Small Letters ( a – z ), and Digits ( 0 – 9 ).
  2. Blank spaces and commas are not allowed.
  3. No Special Symbols other than underscore(_) are allowed.
  4. First Character should be alphabet or Underscore.
  5. Variable name Should not be Reserved Keywords.Keywords are reserved words which have standard, predefined meaning in C. They cannot be used as program-defined identifiers.

Generally all keywords are in lower case although uppercase of same names can be used as identifiers.

Keywords in C :

  • char
  • int
  • long
  • union
  • continue
  • goto
  • while
  • if
  • double
  • enum
  • const
  • for
  • sizeof
  • do
  • else
  • struct
  • register
  • float
  • signed
  • volatile
  • typedef
  • switch
  • break
  • extern
  • short
  • void
  • auto
  • case
  • static
  • return
  • unsigned
  • default
These are the major keywords used in C Language, let’s see with more in the next post.

Leave a Comment