First C Program

The above Program will produce the following Output :
My First Program running Perfectly

Line 1 and 2 :  
“#include” is a preprocessor directive
“stdio.h”(Standard Input Output) and “conio.h”(Console Input Oputput) are the Header files which contain the definitions of function clrscr(), printf() and getch()
“.h” extension represents that this is a header file.

Line 3 : void main()

“void” is the return type of “main” function representing that this function will NOT return anything.
“main()” is the function that is also consider as the point of execution.

Line 4 : {

“{” This is a opening brace that always come with a corresponding closing brace “}”. It is used to create a block of codes.

Line 5 : clrscr()

“clrscr() ” is a pre-defined function means it has been defined previously and its definition is available in one of the header files.
Definition of clrscr() function is defined in “conio.h” header file that is the reason why we included it in our program
This function is used to clear the output screen that is any content written on the output screen will be wiped away.

“;” This is a terminator used to mark as the end point of a statement.

Line 6 : printf(“My First Program running Perfectly”);

“printf()” is also a pre-defined function  whose definition is available in “stdio.h” header file.
The parameter is passed inside the DOUBLE QUOTES and are printed as it is on the output screen.*
No matter what you will write inside double quotes it will be printed as it is on the screen.*

Line 7 : getch();

“getch()” is a predifned function whose definition is available in “conio.h” header file.
It is used to SQUEEZE the screen. *

This was all about your first program of C language . Hope you will find this helpful.

* Not exact definition. More precise definition will be explained in later posts.

Leave a Comment