Header Ads Widget

C: Basic Syntax of a C Program- Sparsh Blog

KEYWORDS AND IDENTIFIERS IN C

What is a C program made up of❓

🠞A C program is made up of constant, indentifiers, string literals, keywords & Symbols.


Keyword:-

🠞These are the reserved words in C programming language. These are 32 in total.

Example of Keywords are- int, return etc.





List of all the 32 Keywords are:-

break            double        int                 struct
case              else             long              switch
char              enum          register         typedef
const            extern         short             union
continue       float            signed          unsigned 
default          for              size of          void
do                 goto            static            volatile
auto              if                 return           while


Identifiers:-

🠞They can be type name of a function or variable

  • C does not allowed punctiation characterslike @, $, % etc
  • C is a Case Senstive programming language.



Rules for naming identifiers:-

  1. A valid identifier can have letters (both uppercase and lowercase letters), digits and underscores.
  2. The first letter of an identifier should be either a letter or an underscore.
  3. You cannot use keywords like int, while etc as identifiers.
  4. There is no rule on how long as identifier can be. However you amy run into problems in some compiler if the identifier is longer than 31 characters.

THANK YOU FOR READING THIS ARTICLE ON-

SPARSH BLOG


If you want to suggest any changes in the program please feel free to contact us in the comment section or you can reach us using Contact us Page.

Post a Comment

2 Comments

If you want to give any suggestion regarding the post please feel free to Comment below-