
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
Explain C tokens in C Language
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
", 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.
- Related Articles
- Tokens in C
- C/C++ Tokens?
- Explain switch statement in C language
- Explain Binary search in C language
- What are tokens in C#?
- Bag of Tokens in C++
- Explain Squeeze Function C language
- Explain the sorting techniques in C language
- Explain the different sections in C language
- Explain ‘simple if’ statement in C language
- Explain if-else statement in C language
- Explain nested switch case in C language
- Explain the Character operations in C language
- What are the tokens in C ?
- Explain the history of C language?

Advertisements