Character Set, Keywords and Identifiers in C (explain with Examples)


When, we are starting to learn an English language. First of all, we must need to know basic words in English language. Like, Alphabets (A to Z) and other words. Thus, we need basic words and other letter to learn C programming language 

So guys, Let's see below about basic words of C program.



Character Set:-

The set of characters that are used to form words, numbers and expression in C is called C character set. The combination of these characters forms words, numbers and expressions in C. 

The characters in C are grouped into the following four categories.

1) Letters or Alphabets 
2) Digits
3) Special Characters
4) White Space





1)  Letter or Alphabets 

i.) Uppercase alphabets = (A....Z)
ii.)  Lowercase alphabets = (a....z)



2)  Digits 

All decimal digits = 0 1 2 3 4 5 6 7 8 9



3)  Special Characters

Comma = ,                                  Ampersand = &
Period = .                                    Caret = ^
Semicolon =                           Asterisk = *
Colon =                                      Minus sign = -
Question mark ?                        Plus sign = +
Apostrophe =                           Less than sign = < 
Quotation mark = "                   Greater than sign = >
Exclamation mark = !               Left parenthesis = (
Vertical bar =                          Right parenthesis = )
Forward slash =                     Left bracket = [
Backslash =                             Right bracket = ]
Tilde =                                     Left brace = {
Underscore =                          Right brace = }
Dollar sign = $                           Number sign = #
Percent sign = %



4)  White Space

i)   Blank space 
ii)  Horizontal tab
iii) Vertical tab
iv) Carriage return
v)  New line or line feed 
vi)  Form feed 





Keywords:-

Keywords are predefined words for a C programming language. All keywords have fixed meaning and these meaning can not be changed. They serve as basic building blocks for 

program statements. (ANSI) C keywords are listed below.  

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

These keywords are used for predefined purpose and can not be used as identifiers. Thus, Keywords are also called reserved words.





Identifiers:-

Identifiers are names for entities in a C program. such as variables, arrays, functions, structures, unions and labels. They are names given by the user and consist of a sequence letters and digits, with a letters as the first character. The underscore character can also be used to link between two words in long identifiers.

Rules for constructing identifiers. 

* It must be a combination of letters and digits and must begin with a letter.
* Underscore is permitted between two words, but white space is not allowed. 
* Only first 31 character are significant.
Keywords can not be used.
* It is case sensitive. i.e. uppercase and lowercase letters are not interchangeable. 





Thanks for all....




Comments

  1. Join our Best Artificial Intelligence Course In South Delhifor a transformative journey. Master crucial skills, learn from experts, and advance your career in the world of Artificial Intelligence.

    ReplyDelete

Post a Comment

Popular posts from this blog

Basic Structure of C Program. (Explain with Example)

Learn C Programming Languages ( Definitions and Advantages).

Data Types in C (types and examples)