What is token in C Programming
The basic and smallest unit of a C program is called C tokens.
There are six types of token in C.
- Keywords: Keywords are special words that are used to give a special meaning to the program and can’t be used as variable and constant. They are basically a sequence of characters that have fixed to mean for example break, for, while, do-while, do, if, int, long, char.
- Identifiers: Identifiers are the sequence of alphabets and digit, but keyword should not be used as an identifier.
- Constants: The quantity which does not change during the execution of a program is known as constant. There are types of constant.
- Variables: Variables are used to give the name and allocate memory space. An entity that may vary data during execution. For example, sum, area, a, b, age, city.
- String: String is a collection of more than one character. For example, “RAM”, “Meerut”, “Star” String is represented by a pair of double quotes.
- Operators: Operators acts as connectors and they indicate what type of operation is being carried out. The values that can be operated by these operators are called operands. They are used to perform basic operations, comparison, manipulation of bits and so on.