Posted By:
9 Feb, 2014 2:02 am PST

First program in C


First Program

We all love Quick fixes, right?

C has come with a set of Libraries that are pre-defined, which help us perform many complex operations. We need to just import those libraries before writing the program. The library files are also called as Header Files, which have an “.h” extension.

After we install Turbo C, we can find the header files in “Include “directory.

Note: “//” are used as comment lines. That particular line which starts with “//” doesn’t come into picture when compiler compiles.


The syntax of importing the libraries is:


#: This is a pre processor directive.

stdio.h: Standard Input Output Header file contains all the functions required for Input and Output operations.

So we import that header file using “include<stdio.h>”.

It includes the functions in “stdio.h” header file.


Program on the whole


int main()


printf(" Hi! Welcome to C tutorial ");






It is a pre processor directive that tells the compiler to load all the functions stored in STDIO header file.(STDIO-> Standard Input Output ).



This is a Data type that tells the compiler that a integer type is returned as output.



This is the main function of the C language . "()" are the parenthesis that tells us that it is  a function.



This is a flower bracket that indicates the start of a code.



This is a function that is used to print something onto the console ( Screen ) .



Semi-colon is used to indicate the end of statement.



After compiling the program , when we run it , the output is displayed in a separate black  console which will close automatically, once the output is displayed, in seconds.



 tells the compiler that the program is successful.




1)       Open Turbo C


2)       Click on File and press New.




3)       Type in the first program.



4)       Save the Program , click on File -> Save as -> enter required name.



Compile the Program.

5)       "compiled"


      Run the program .




7)       Voila! Output is displayed.


Please login to reply to this problem.