The contents of this blog are not old now as I have not updates it since long. The mobile trick wont work now.

Learn C programming

Posted on Wednesday, October 14, 2009 by Ajit

Friends,
This is a very simple article regarding how to start with "C" programming. Let me first explain what is "C", It is basically a middle level language developed to make ease of the coding as compared to assembly level language.
Install Turbo C or whatever compiler known to you..........

To start with; Initially I suggest you to just know a simple header file "stdio.h".Now the question is, what is this header file ?. So the answer to this question is, this is a file called as standard input-output i.e is helps to call the pre defined functions like printf() and scanf().
so here is the syntax about how to write it.

#include

the "include" above informs the pre-processor to include the package.

Then, let us start with the main function, always remember that main is the function which gets executed first irrespective of its position in the code.
The syntax for main is

void main()
{
}

here the void specifies the return type i.e value returned by the function (not to worry for now, you will understand it later on)
The "{", "}" denotes the brackets in which whole code is written.

lets take an example

void main()
{
printf("Hii");
getch();
}

How to run a program ?
1)COMPILE ==> alt+F9
2)Run ==>ctrl+F9

In the above code there are 3 things to be noticed.
1) The printf statement is containing the value to be printed but, it is in quotes.
2)All the statements are ended by a ";"
3)"getch()", This is something which you would be worried about.Basically it a function for a character to be inputted. Now this function is used here just to make the output screen visible, and when you press any key then the sereen will exit.
you can run the program without getch() and see it.

Further part would be explained depending only upon your interest, please comment if any help is required.