Character set
A character set is a set of alphabets, letters and some special characters that are valid in C language.
Token
A token is the smallest unit in a 'C' program. A token is divided into six different types as follows,
- Keywords (eg: int, while),
- Identifiers (eg: main, total),
- Constants (eg: 10, 20),
- Strings (eg: “total”, “hello”),
- Special symbols (eg: (), {}),
- Operators (eg: +, /,-,*)
Variables
It is a data name used for storing a data value. Its value may be changed during the program execution. The value of variables keeps on changing during the execution of a program.
Data Types
A data type specifies the type of data that a variable can store such as integer, floating, character, etc.
Keywords
A keyword is a reserved word. You cannot use it as a variable name, constant name, etc. There are only 32 reserved words (keywords) in the C language.
Auto | Double | Int | Struct |
Break | Else | Long | Switch |
Case | Enum | Register | Typedef |
Char | Extern | Return | Union |
Const | Float | Short | Unsigned |
Continue | For | Signed | Void |
Default | Goto | Sizeof | Volatile |
Do | If | Static | while |
Identifiers
Identifiers are names of variables, functions, and arrays. They are user-defined names, consisting sequence of letters and digits, with the letter as the first character.
Constants
Values do not change during the execution of the program Types:
Numerical constants:
Integer constants
These are the sequence of numbers from 0 to 9 without decimal points or fractional part or any other symbols. It requires minimum two bytes and maximum four bytes.
Eg: 10,20, + 30, – 14
Real constants
It is also known as floating point constants. Eg: 3.5, 6.342
Character constants:
Single character constants
A character constant is a single character. Characters are also represented with a single digit or a single special symbol or white space enclosed within a pair of single quote marks
Eg: ‘a’, ‘6’, “ ”.
String constants
String constants are sequence of characters enclosed within double quote marks. Eg: “Hello”, “goeduhub”, “234”