# Explain C tokens in C Language

CServer Side ProgrammingProgramming

#### C in Depth: The Complete C Programming Guide for Beginners

45 Lectures 4.5 hours

#### Practical C++: Learn C++ Basics Step by Step

Most Popular

50 Lectures 4.5 hours

#### Master C and Embedded C Programming- Learn as you go

66 Lectures 5.5 hours

Tokens are generally smallest, indivisible units in a C program with different meanings.

## Types of Tokens

The various types of tokens in C are as follows −

• Identifiers − This refers to the name of the functions, variables, arrays, structures, etc.

• Operators − These are the symbols that tells to the C compiler to perform some logical, mathematical, or relational operations.

• Special Characters − All characters except alphabets and digits are called special characters.

• Constants − Some fixed values that cannot be changed during the program execution are known as constant terms

• Keywords/Reserved Names − These are Predefined words with some special meanings that cannot be used as variable names.

## Example

Following is the C program for usage of tokens −

#include<stdio.h>
int main(){
int p, q, result;
p = 2, q= 3;
result = p + q;
printf ("result = %d \n", result);
}

Here,

• main is identifier.
• {,}, (,) are delimiter.
• int is a keyword.
• p,q, result are identifiers.
• main, {, }, (, ), int, p, q, result all together called as tokens.
Updated on 11-Mar-2021 08:19:50