Saturday, 15 September 2012

Learn C with me Chapter 2


Chapter 2.

In Previous chapter we saw about basics of program interfacing with computer.
Now you might be knowing that every C code start with an header file. But very few of us might be knowing that why are this Header files used??
Lets start with it....
Start Your C programming software with me.

#include<stdio.h>//Header
#include<conio.h>//Header
/*
A header file is a group of
pre defined, general purpose,
functions.
        Examples of predefined functions are "Printf(), Scanf(), etc"

        We can include a header file in
our prg and can use its functions
directly.
*/

void main()
{
clrscr();//clear output window
//and postion cursor on top left.
printf("\nHello f");
printf("\nHello f1");
printf("\nHello f2");
printf("\a\a\a\a");//beep (alert)

//printf support outputting
//special characters  like \n,\t that
//are not actually displayed
//but are for cursor movement
//and other purposes.
        //Semicolon (;) indicates end of the predefined function.
}

No comments:

Post a Comment