Friday, February 20, 2009

ABC'S OF PROGRAM

What is program basically?the answer is simple Program is the Group of instructions which when execute perform a desire task.Assume that a civil engineer is constructing a building then what he should do? he must follow certain steps which are essentials to make a building.similarly programmer follows certain steps which are nothing but the syntax of a language and the logic use in a program.
In a C language Program There is a header in which you write the name of the file such as "stdio.h" and "conio.h"then a special type of function occurs which is called as a Main() function
In a main() function we write all the code. For Example
Note:
First install turbo c++ compiler or download from (http://www.4shared.com/file/45455435/bf6991ec/Turbo_C_v30.html?s=1)

#include <stdio.h>// file/library name.
#include <conio.h>//
Main()
{
printf("hello world"); //defined in stdio.h
getch(); //defined in conio.h
}
output:
hello world

OK ,Is the question arise in your mind that what are files or library?File in c language is the place where the bodies of function defined such as "printf();"in "stdio.h" and "getch();"in "conio.h" If you are using functions from the file then you must give the reference of it as in the above program.In the beginning you use builtin function we will talk about custom functions later,try above code by writing desired sentence in printf function.

No comments:

Post a Comment