C "Hello World" Program

There are many ways to write an hello world program in c programming, but the given below program will help you understand the correct way to write.

  • I am using the gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0.

  • In Simple Words I am Using the GCC Compiler in Ubuntu(Linux Machine) O.S. (Operating System), lubutu flavour.
  • Source Code Editor Or IDE : Visual Studio Code & Nano Source Code Editor.
  • Check Solutions for Errors At here



Code

#include <stdio.h>

int main() {
  printf("Hello World\n");
  return 0;
}


Output

An Output Image of C "Hello World" Program. It Will Republished With The Image



Frequent Errors

  • For Turbo C/C++ Compiler Users :

    • Add An Header like this "#include <conio.h>" below the "#include <stdio.h>".

    • Add An New Line "clrscr();" below the "int main() {".

    • Please Use "int main()" with "return 0;" instead of using "void main()" only to prevent errors

  • For Beginner Programmers :

    • Please Compile First After Saving the C File And After That Run The program.

    • Reason : It Is Compiled Language.



Other Errors if any

This Section is an iframe of the solutions of this Program informed By Comments.



End of Post.

Comments