Pages - Menu

Saturday, 19 July 2014

Writing First Program in C.


Type the program as:

#include <stdio.h>       
/* inserts the code to use the fuctions like printf bydefault*/
int main ( int argc, char *argv[] )  
/* Program execution starts from here argc is used to get number of command line arguements(input from command prompt) and argv[] stores the command line arguements*/
{
   printf("WELCOME TO THE WORLD OF C PROGRAMMING");
/* print the written string */
   return 1;
/* return from the execution*/
/* Lines between me are comments you can skip these lines these are just to explain the things */

For Turbo C users.

#include <stdio.h>     
#include<conio.h>
/* inserts the code to use the fuctions like printf bydefault*/
int main ( int argc, char *argv[] )  
/* Program execution starts from here argc is used to get number of command line arguements(input from command prompt) and argv[] stores the command line arguements*/
{
   printf("WELCOME TO THE WORLD OF C PROGRAMMING");
/* print the written string */
           getch();                            //To hold the output screen
   return 1;
/* return from the execution*/
/* Lines between me are comments you can skip these lines these are just to explain the things */

No comments:

Post a Comment