Writing Your First C Program
Writing Your First C Program
#include<stdio.h>//line 1
#include<conio.h>//line 2
void main() //line 3
{ //line 4
clrscr(); //line 5
printf("Hello World!! This is my first C Program"); //line 6
getch(); //line 7
} //line 8
Explanation of Program
line 1 : This line incude header file stdio(standard inut output ) which contains predefined function printf() and scanf(). # is a preprocessor directive and include is a command.
line 2 : This line include header file conio(Console input output) which contains predefined functions clsrscr() and getch().
line 3 :This is main function or we can say a driver function .this is the part from where our program runs that is why it is also called as the driver function. Every code of a program ,directly or indirectly,comes inside the main function.
void used in front of main function is the return type of main function . Every function returns some value so main function returns value of void type.
Comments
Post a Comment