Print Hello World C Program

C Program To Print Hello World

Learn How To Print Hello World in C Programming Language in Linux Ubuntu OS. Here, we have also explained how to execute hello world c program in Linux Ubuntu.

This is the very first program in every programming language. It helps to understand the basics of input and output of any programming language.

Method 1: C Program To Print Hello World Program in Ubuntu

Must Read: C Program To Print Hello World without Semicolon

Method 2: Hello World Program in C Programming using Command Line

Must Read: C Program To Check if Number is Armstrong or Not

Method 3: Print Hello World C Program using String

Must Read: Find Simple Interest in C Programming

Method 4: C Program To Display Hello World using Macro

Must Read: C Program To Swap Two Numbers using Call By Value

Steps To Execute Hello World C Program in Linux Ubuntu

  • Create a Text File (using gEdit) named HelloWorld.c on Linux Ubuntu Desktop.
  • Paste the above code into the Text file and Save it with a .c extension.
  • Open Ubuntu Terminal by pressing Ctrl+Alt+T.
  • Type: cd Desktop and Hit Enter.
  • Type:gcc HelloWorld.c and Hit Enter. This step helps in Compiling C Programs.
  • To Execute the program, use the command ./a.out.
  • Now, you would be able to see the Output as Hello World on the Terminal.

Must Read: C Program To Find Factorial of a Number


C Program To Print Hello World

If you have any compilation error or doubts in this C Program To Display Hello World, let us know about it in the Comment Section below.

3 thoughts on “Print Hello World C Program

  1. Ajit Kadam

    You have used Hello World statement in Command Line Hello World Code. We have to print hello world in Command Line as arguments.

    1. Tushar Soni Post author

      We have passed default values here. If you want then you can remove this default value and pass your Hello World statement via command line. No issues in that.

  2. Mehak Chahal

    It is advisable to have return 0; statement at the end if you’re using int main() as it is considered as one of the best practices to program in C language.


Let's Discuss