A program is nothing but a set of instructions which means words and symbols. These instructions are following certain rules called as Syntax Rules. C Syntax rules specify the sequence of characters, vocabulary and grammar in the program.
In C-Language, characters are divided into the following categories:
Letters (all alphabets a to z & A to Z).
Digits (all digits 0 to 9).
Special characters such as colon (:) , semicolon (;), period (.), underscore (_), ampersand (&) etc.
C Syntax Rules
Every statement in C-program should end with a semicolon.
White spaces are taken into consideration when keywords and identifiers are used.
C is a case sensitive. So all the instructions should be given in lower case.
C-tokens are the basic building blocks and smallest individual unit in writing a C-program. Tokens come together to form a program. They are divided into 6 types.
int x, y, total;
Keywords are those words whose meaning is already defined by Compiler i.e. include, int, main.
Keywords are pre-defined words in C-Language.
Keywords and variable names are not same, as keywords are already reserved in the compiler.
Every keyword has its own meaning and cannot be edited by the programmer.
There are 32 keywords in C-language.
Identifiers refers to the names of variable, types, functions, labels and arrays. Unlike Keywords, Identifiers are user-defined and can be changed as per the requirement.
First character of the identifier should be an alphabet(A-Z or a-z) or underscore( _ )
First character should never be a digit or any other symbol except underscore.
Identifiers are also case-sensitive.
C syntax chapter draws out following main points.
C-language is case sensitive.
32 Keywords in C-language which are pre-defined.
Identifiers are user-defined.
Never use keyword as a variable name or function name as they are inbuilt in the system.