0% found this document useful (0 votes)
5 views4 pages

C Program General Structure

The document outlines the general structure of a C program, including the use of header files, the main function, variable declaration, and the clrscr() function. It explains the purpose of header files like <stdio.h> and <conio.h>, and describes how the main function serves as the entry point for program execution. Additionally, it provides syntax examples for variable declaration and usage.

Uploaded by

valvi kuldip
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

C Program General Structure

The document outlines the general structure of a C program, including the use of header files, the main function, variable declaration, and the clrscr() function. It explains the purpose of header files like <stdio.h> and <conio.h>, and describes how the main function serves as the entry point for program execution. Additionally, it provides syntax examples for variable declaration and usage.

Uploaded by

valvi kuldip
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

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();

You might also like