Monday 12 August 2013

Little Introduction for Beginners of C Programing

And E-Book is available on below link.

E-Book of Ansci C Balaguruswamy : Download E-Book (External Source)

In C Program, we include header files in which external/predefined functions declared.
These functions will be used in our programs, so related header file will be included.

->In C Program, double slash "//" is used to comment a single line.
   And /*..*/ is used to comment multiple lines.
->Commented line will not be compiled during compilation.
    It is good practice to write comments in program. Comments will help to understand the program.

->Every line must end with semi-colon ";"

->main() is the function denotes to compiler starting of program for compilation.


General format of C Program

//Header or Title or Definition of program

#include<...h> //Header File(s)

globle varible declaration

main()
{ //Program Starts
     Loca Variable declaration;
//     Executable part of program
     Input/Output Operation

}//end of program

user defined functions()
{
}

Important shortcuts for Turbo C Compiler
To Compile Program : ALT+F9
To Run Program : CTRL+F9
To View output/previous screen : ALT+F5

Open Turbo C and write following program.

First C Program
//Simple program to display "Hello World"

#include<stdio.h>
void main()
{
     printf("Hellow World...!!!");
}

check for errors by ALT+F9
if no errors hit CTRL+F9 to run program
and to check output hit ALT+F5


Now you can write C programs.....

No comments:

Post a Comment

Contact Form

Name

Email *

Message *