C Programming/C Basics

C Tokens

Updated on January 8, 2026
1 min read

Tokens in C Programming Language

In C language, tokens are the smallest individual units of a program. The C compiler breaks a program into tokens to understand and compile it.

Types of C Tokens

There are 6 types of tokens in C:

1. Keywords

Keywords are reserved words with predefined meaning in C. They cannot be used as variable names.

Examples:

 intfloatifelsereturnwhile

2. Identifiers

Identifiers are names given to variables, functions, arrays, etc.

Rules:

  • Must start with a letter or underscore
  • Can contain lettersdigitsunderscore
  • Cannot be a keyword
  • No spaces allowed

Examples:

 total_countsum1

3. Constants

Constants are fixed values that do not change during program execution.

Types of constants:

  • Integer constant: 10-25
  • Floating constant: 3.142.5
  • Character constant: 'A'
  • String constant: "Hello"

4. Operators

Operators are symbols used to perform operations.

Types:

  • Arithmetic: + - * / %
  • Relational: > < >= <= == !=
  • Logical: && || !
  • Assignment: = += -=
  • Increment/Decrement: ++ --

5. Special Symbols

Special symbols help in program structure and syntax.

Examples:

 { } ( ) [ ] ; , #

6. Strings

A string is a sequence of characters enclosed in double quotes.

Example:

 "C Programming"

Example Showing C Tokens

int sum = 10 + 20;

Tokens used:

  • int Keyword
  • sum  Identifier
  • = Operator
  • 1020  Constants
  • +  Operator
  • ; Special symbol

Important Points

  • Tokens are the basic building blocks of a C program
  • Compiler reads programs token by token
  • Understanding tokens helps in learning syntax easily
C Tokens | C Programming | Learn Syntax