Wednesday, 9 May 2012

Basic Structure of C Program



#include<stdio.h>
The # sign indicates that this is an instruction for the C compiler and includes information about how to use the functions from the <stdio.h> stand for Standard Device Input/Output header. Usually the standard input device is your keyboard and the standard output device a terminal which is displayed on your monitor. One item included in this header is a declaration of the function printf(). This library is very widely used.

#include <conio.h>
This line tells C to include information about how to use the functions from the Common Input Output library.

void main()
main() is a program building block called function. C programs contain one or more functions, exactly one of which must be main. The keyword void to the left of the main indicated that main can not return any value. The parentheses after main indicates that main is a program building block called function.
{ the left braces begin the body of every of every function and a corresponding right brace } must means end the body of each function.

clrscr();
It is a built in function for clear screen and as ; (semicolon) at the end of line its means that the statement end with ; all the statements in C are terminated ; (semicolon) called terminator.
printf(“Hello! Students.”);
It is also a built in function of C to interact compiler for print message in console output screen, which are mention with parentheses and double quote.

getch();
It is also a built in function, this function can get any character from user on run time, and mostly this function is used for stop any program on any specific location when user can enter any key then program goes on.

No comments:

Post a Comment