C Program general structure
Header file
main function
{
Variable declaration;
Clrscr();
Input/output statement;
genral stat/expression/condtion/loop;
Output display;
getch();
return 0;
}
1.Header file
#include<headerfile>
1. Pre processor directive
#include is a pre processor directive.it includes
the header files in our program.
2.header file
Header files are the library file which contain the
definition for various function
1. <stdio.h>
standard input/output header file.
Used to support various i/o function in
program
#include<stdio.h>
2. <conio.h>
CONSOL input output header file
It support display related function.
#include<conio.h>
main( )
it a starting point or entry point of program.
Every prog start with main()
Program execution always start from main()
Syntax
Int main()
Or
main()
when program return integer value.
void main()
when program does not return any value.
3.Variable declaration
Variable is temporary memory location.
It is used to store the i/o value.
Syntax
Datatype variable name;
int rollno;
char name[10];
float percentage;
int x,y,z;
4.clrscr()
clear screen function
it used to clear previous output from output
screen
#include<stdio.h>
#include<conio.h>
main( )
{
int a,b;
flaot x,y;
char name[10];
clrscr();