Friday, 30 June 2017

My First C Program "HELLO WORLD" !!!

#include <stdio.h>                           // stdio.h header file for standard input output.

int main()                                         // c program execution start from main function,
{
    printf("Hello, World!\n");         // printf is a function defined in stdio.h header file.

    return 0;                                      // return 0 indicate successful execution .
}


In the above C program stdio.h is a header file where all the standard library functions are written by the C Programmers here 'std' stands for standard and 'io' stands for input output, so in this stdio.h header file all the input-output related code is pre-written here.
           Next we have the 'int main(){  }' it is a most important and compulsory part of a c program because main function is the point from where the execution of the program started. 'int ' before the main is its return type and int stands for integer.

           Printf is a predefined function in stdio.h and works for standard output on the screen.

           return 0, Indicate successful execution of the program, the main function can return two value either  0 indicating success or -1 indicating failure.


Comment : If having Doubt. 

No comments:

Post a Comment