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. 

what is C programming ?

Before getting started with C programming, lets get familiarized with the language first.
C is a Low level structured programming Language developed by "Denis Ritchie" in 1973 at bell lab's. Initially It was written to develop the Unix operating system but later become suitable for System Programming and as general purpose programming language.                                                                       As the language was written as a low level language it was rather easy for the machine to understand the c language then other language of that time.
C is a general-purpose programming language used for wide range of applications from Operating systems like Windows and iOS to software that is used for creating 3D movies.
C programming is highly efficient. That’s the main reason why it’s very popular despite being more than 44 years old.
Standard C programs are portable. The source code written in one system works in another operating system without any change.
As mentioned, it’s a good language to start learning programming. If you know C programming, you will not just understand how your program works, but will also be able to create a mental picture on how a computer works.