To develop a program what fundament components are required those are called characteristics of C
The classical method of learning English is to first learn the alphabets used in the language, then learn to combine these alphabets to form words, which in turn are combined to form sentences and sentences are combined to form paragraphs. Learning C is similar and easier.
Smallest individual unit of a program is known as token.
Keywords are the words whose meaning has already been explained to the C compiler. The keywords cannot be used as Identifiers because if we do so we are trying to assign a new meaning to the keyword, which is not allowed by the computer.
There are only 32 keywords available in C.
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 |
Identifier refers to name given to entities such as variables, functions, structures etc.
Identifiers must be unique. They are created to give a unique name to an entity to identify it during the execution of the program
Note:identifier names must be different from keywords
Rules for naming identifiers
In C language constants refers to fixed values that do not change during execution of the program
They are also known as escape sequence character constants. They are used to have formatted output.
The below table shows different types of escape sequence characters available in C language
Constant | Meaning |
---|---|
\a (Beep sound) | Gives beep sound in printing results on output screen. |
\b (Backspace) | Prints the output one space back |
\f Form Feed | Gives the form feed |
\n New Line | Prints the output in new line |
\r Carriage Return | Cursor is returned to the required place |
\t Tab (Horizontal) | Prints tabspace on the output screen |
\v Vertical Tab | Prints tabspace vertically |
\\ Backslash | Prints the backslash |
\´ Single Quote | Prints the single quoute |
\" Double Quote | Prints the double quote |
\? Question Mark | Prints the question mark |
\0 Null | Used to terminate the string |