Structure of c language
The structure of C program is as follows:
# include<stdio.h>
void main (void)
{
printf(“ ”);
getch();
}
#preprocessor
This symbol direct the compiler that content on this line is already processed.
include
This directive indicate that the standard library object file have to be attach with the program.
<stdio.h>
This is header file which contain instruction for the predefined functions of the language.
Standard input/output header file contain the instruction for getting and displaying of data on screen.
Types of Header files:
Header file in angle brackets is language define ( <header file> ) and header file in double quotes is user define ( "header file" ).
Main Function
This direct the compiler to start the compiling from the point.
Void main (void)
First void show we are not getting any value from program.Second void in bracket called argument or parameter shows we are not giving or passing any value to the program.
{} Delimiters
The body of program is written in between these delimiters.
Opening brace "{" shows start of the program.
Closing brace "}" shows end of the program.
Body of program
Body of program consists of statements or set of statements.Each statement ends with a semicolon (;) known as terminator which tell the compiler where one statement is ended.
Printf(" ")
Printf() function is use to display content written in double quotes on screen.
# include<stdio.h>
void main (void)
{
printf(“ ”);
getch();
}
#preprocessor
This symbol direct the compiler that content on this line is already processed.
include
This directive indicate that the standard library object file have to be attach with the program.
<stdio.h>
This is header file which contain instruction for the predefined functions of the language.
Standard input/output header file contain the instruction for getting and displaying of data on screen.
Types of Header files:
Header file in angle brackets is language define ( <header file> ) and header file in double quotes is user define ( "header file" ).
Main Function
This direct the compiler to start the compiling from the point.
Void main (void)
First void show we are not getting any value from program.Second void in bracket called argument or parameter shows we are not giving or passing any value to the program.
{} Delimiters
The body of program is written in between these delimiters.
Opening brace "{" shows start of the program.
Closing brace "}" shows end of the program.
Body of program
Body of program consists of statements or set of statements.Each statement ends with a semicolon (;) known as terminator which tell the compiler where one statement is ended.
Printf(" ")
Printf() function is use to display content written in double quotes on screen.