A smallest individual unit in C program is known as C Token. Tokens are either keywords, identifier, constants, Variables, string literal or any symbol which has some meaning in C language. A C program can also be called as a collection of various tokens.

i.e:- printf(“Hello, World! \n”); consists of five tokens

Load WordPress Sites in as fast as 37ms!

1- printf, 2- (, 3- “Hello, World! \n”, 4-), 5- ;

Semicolon:- Semicolon ; is used to mark the end of a statement and beginning of another statement. Absence of semicolon at the end of any statement may lead to syntax error.

Comments:- Comments are ignored by the compiler.We write comments for better understanding of the program.

Load WordPress Sites in as fast as 37ms!

There are two ways in which we can write comments in C program

  1. Using //:- This is used to write a single line comment.
  2. Using /* */:- The statements enclosed within /* and */ , are used to write multi-line comments.

** We cannot have comments within comments.

Load WordPress Sites in as fast as 37ms!

Some basic syntax rule for C program

  1. All C statements must end with a semicolon.
  2. Whitespace is required between keywords and identifiers.
  3. C is a case sensitive language and all C instructions must be written in lower case
  4. Whitespace is used in C to describe blanks and tabs.
Sharing is Caring
Load WordPress Sites in as fast as 37ms!
Scroll to Top