C Basic syntax rules and use explanation

Some most used C basic syntax

C Basic Syntax is very easy. In this tutorial, I have explained it in a systematic manner.

We will focus on the syntax and the program structure in C.

C Basic Syntax:-

void main()
    printf("C Language.");

Result :-

C Language.

Explain : –

<stdio.h> is the preprocessor library. which have some function inside it, like printf(), sprintf(),sscanf(), scanf(),vprintf(), vsprintf and many more, that’s we include this library before we start the program. the full form of stdio.h is Standard Input Output file.header.

is the console input-output file. header. it also have many function. have clrscr(), getch(),getche(), textcolor().

the void is the keyword, the function used.that’s why function does not return anything. if we use data type instead of void then the function must return any value.

main() is the function. compiler or interpreter start checking of the program from main(), that’s why main is the important part of the program. So, you must have the main inside the program.

printf() is the function. which is used to print any value of a string .

getch() is the String type function. which will for any input at run time. so that you can see your output easily.

{ this is the start curly brace, which shows the starting of the program. } this will show the ending of the program.

Comments in C Language:-

We have two types of Comment in C Language.

Single line comment.

Example: – // this is a Syntax of Single Line comment.

Multiple Line comments.

Example : –


Contents inside the comments are not recognized by the compiler or interpreter. it is only for use of programmer, to understand the flow of the programs.


After some days, when you try to understand the program, these comments help you to understand the program.

Comments are part of good documentation.

Leave a Reply