Sunday 6 February 2022

A Simple Hello World C Program

iCode Buzz   
                 

Algorithm :

First you can see we have added  a thing which looks like " #include<stdio.h> " it means that you are including an library of c programming language which is " std " means ' standard ' in " < > " this signs and " io " means ' input output ', this is an ' header ' file so " h " is also included with it and both ( library name and header-h) are seperated with an dot ( . ).

" #include<stdio.h> " It sounds like ' include standard library of input output in header '

Now, " int " it is an data type of c language.

In C language execution start's from the ' main ' function and everything between { } will be executed after compiling it.

and in the last " return " , it is an keyword of C language that says this function (main) return's 0 (nothing).

/*    End of program.    */


Code :

 #include<stdio.h>                                                   

 int main()                                                                

 {

           printf("Hello World, Learn coding with iCode Buzz");       

           return 0;

 }

4 comments:

  1. Replies
    1. Can I change main method name to any other name like khanMain

      Delete
    2. No buddy you can't make any changes to main function name, it an function name of c language and all execution starts with it, suppose if you made any name difference of main function then your compiler will get confused to where to start compiling your program. Thank you, if again you have any doubts then share with me i will response you very soon.

      Delete