Monday, July 14, 2008

First C program

#include
#include
void main()
{
printf("Hello World");
}

u can run the prog. by pressing ctrl+F9;;
But wheres the output??
ok

here u have to put a function "getch()" at last of the prog.
so now type it->

#include
#include
void main()
{
printf("Hello World");
getch();
}

now run the prog. u will see Hello World 2 times.
the 1st one is the output of previous execution & the second one is of next execution.

#include:- now its enough to know that this is the syntax to call the header-files like(stdio,conio,math etc.); after calling this header files;we can run the functions like printf(),getch().

void main():- dis is the main function block from which all the codes are executed.we will discuss about function later.

{}:-by this parenthesis we can point the starting and the ending of a block.

printf():- this is the function used to print something.the text inside of the quotes " " will be printed.

getch():- its a function used to get character from keyboard i.e if u don't press any key then the statements after getch() will not be executed.

0 comments: