Tokens in c programming language

💫 Tokens in C Programming Language👈😍

Tokens are the smallest individual units of a C program.

1. Keywords

Reserved words used by the C language.

Examples:

int, float, char, double, if, else, for, while, do, switch, case, break, continue, return, void, static, struct, union

2. Identifiers

Names given to variables, functions, arrays, etc.

Examples:

  • sum,
  •  total,
  •  main,
  •  average, 
  • result

3. Constants

Fixed values that do not change during program execution.

Types and examples:

  • Integer constants: 10, -5
  • Floating constants: 3.14, 2.5
  • Character constants: 'A', '5'
  • String constants: "Hello"

4. Operators

Symbols used to perform operations.

Examples:

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

5. Special Symbols (Separators)

Symbols used to separate or group program elements.

Examples:

  • () 
  •  {} 
  •  []
  •  ;
  •  ,
  •  #

Comments

Popular posts from this blog

History of c programming language

Evolution of programming languages

How to Create a Bloger account