C Tokens Overview

In C language, the smallest meaningful unit of a program is called a token. The compiler reads a C program token by token and then checks whether the program follows the rules of C syntax.

Tokens are the building blocks of a C program. Every statement in C is formed by combining tokens such as keywords, identifiers, constants, operators and special symbols.

Types of Tokens in C

Token Type Meaning Examples
Keywords Reserved words with fixed meaning int, if, return
Identifiers Names given by programmer age, sum, studentName
Constants Fixed values 10, 3.14, 'A'
String Literals Group of characters inside double quotes "Hello", "C Notes"
Operators Symbols used to perform operations +, -, =, ==
Special Symbols Symbols used to separate or group code ;, {}, (), []

Note:

Comments are not tokens. Comments are ignored by the compiler. They are written only to make the program easier to understand for humans.

Example:

#include <stdio.h>

int main() {
    int num = 10;
    printf("num is: %d", num);
    return 0;
}

Output:

num is: 10

Explanation of Tokens:

  1. int and return are keywords.
  2. num is an identifier and printf is a predefined function name, so it is also treated as an identifier.
  3. = is an operator.
  4. 10 and 0 are constants.
  5. "num is: %d" is a string literal.
  6. %d is a format specifier used to print integer values.
  7. ;, () and {} are special symbols.

Real-Life Analogy:

Just like a sentence is made by combining words and punctuation marks, a C program is made by combining different tokens.

Summary:

  • Tokens are the smallest meaningful units of a C program.
  • C tokens include keywords, identifiers, constants, string literals, operators and special symbols.
  • Every valid C statement is created by arranging tokens in correct order.

Welcome to ShikshaSanchar!

ShikshaSanchar is a simple and helpful learning platform made for students who feel stressed by exams, assignments, or confusing topics. Here, you can study with clarity and confidence.

Here, learning is made simple. Notes are written in easy English, filled with clear theory, code examples, outputs, and real-life explanations — designed especially for students like you who want to understand, not just memorize.

Whether you’re from school, college, or someone learning out of curiosity — this site is for you. We’re here to help you in your exams, daily studies, and even to build a strong base for your future.

Each note on this platform is carefully prepared to suit all levels — beginner to advanced. You’ll find topics explained step by step, just like a good teacher would do in class. And the best part? You can study at your pace, anytime, anywhere.

Happy Learning! – Team ShikshaSanchar