Menu Close

C Keywords and Identifiers

C Keywords and Identifiers

In this tutorial, we are going to learn c keywords and c identifiers. keywords in c language are specific words with their own feature and syntax. Each keyword in c programming use for specific purposes. identifiers in c language refer to the variable name.

In the previous C tutorial, we have seen a basic introduction of c programming with an example.

In this guide we will see all about keywords in c programming as well as we will see c identifiers.

Character set:

In C programming, A character is a set of alphabets, letters, and some special characters, which are valid in C programming.

Alphabets:

C programming accept both Uppercase and Lowercase as variable name and function.

Uppercase:- A,B,C...........X,Y,Z
Lowercase:- a,b,c..........x,y,z

Digits:

Digits specify number from 0 to 9.

0 1 2 3 4 5 67 8 9

Special Characters:

C programming support various special characters.

List of C Programming Special Characters

  • ~
  • @
  • #
  • $
  • %
  • ^
  • &
  • *
  • .
  • ,

  • (
  • )
  • _
  • +
  • {
  • }
  • |
  • \
  • !
  • :
  • ;
  • >
  • <
  • ?
  • /

C Keywords:

Keywords in c programming are reversed words that means keywords comes predefined with c language, We can not use variable name or identifier as a keyword name. In c programming, each keyword has its own meaning and syntax.

Example

int age;

As you can see in the above example, we declared a variable name age with the int ( Integer ) data type. Here int indicates the c keyword and age indicate the variable or identifier.

Note:- C is a case sensitive language so that all the keywords in c language must be written in lower case.

Here list of all the C keywords

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

All these keywords, their syntax with example explained in their respective tutorial.

C Identifiers:

Identifiers in c language refer to the name that was given to the variable, function, structure, etc.
Identifiers must be unique names give to the entity to identify it during the execution of the program.

let’s understand the c identifiers with simple examples.

int name;
int roll_no;

In above example name and roll_no are C identifiers.

Note:- Identifiers must be different from c keywords. You can not use the identifier name as c keywords name.

Rules for naming identifiers:

To create identifiers in the C program, You must follow some rules.
let’s discuss all the rules step by step.

  • A valid c identifier has letters ( Both Uppercase and Lowercase), Digits, and underscore.
  • The first character of the identifier should be a letter or underscore.
  • You can not use the keywords name as a variable or identifier name.

Note:- Always choose variable name or identifier name meaningful.

Conclusion:

In this tutorial, you have learned keywords in c language and identifiers in c language. If you are a beginner in C programming, Then this tutorial completely for you.

I hope this tutorial will have helped you. If you like this article, please comment and share it with your friends who want to learn c programming.

For More Information:- Click Here

C Programming Tutorial 2023

Related Posts