The structure of statements in a computer language is called Syntax.
- Tokens
- Semicolons
A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol.
In a C program, the semicolon is a statement terminator. i.e, each individual statement must be ended with a semicolon. It indicates the end of one logical entity.
Example :
printf("Hello");
It will terminate the statement after print the Hello.
Comments are ignored by the compiler. It is like helping texts.
There are two types of comments.
- Single line comment
- Multi line comment
Example of single line comment:
printf("Hello"); //Prints Hello
Example of multi line comment:
printf("Hello"); /* Prints Hello */
Identifier is a name used to identify a variable, function, or any other user defined item. An identifier starts with a letter A to Z, a to z, or an underscore '_' followed by zero or more letters, underscores, and digits (0 to 9).
C is a case-sensitive programming language.
C does not allow punctuation character such as @, $ and % in identifier.
Example :
myname
a_name
abc
myName
Keywords are the reserved words by the compiler. There are 32 keywords in C.
We will discuss keywords in brief details in other blog post.
Whitespace is the term used in C to describe blanks, tabs, newline characters and comments. Whitespace separates one part of a statement from another.
Example :
char name;
0 Comments