Let us learn how to print hello world in C programming language in Linux Ubuntu operating system. We have also explained how to execute hello world C program in Linux Ubuntu.
The hello world program simply displays a Hello World to the end user. It is the very first program that every beginner programmer starts with.
This is helpful as this program is usually very simple to implement and it also helps you understand the basic elements and syntax of that particular programming language.
Alternatively, you can also print hello world in C programming without using the semicolon. Check it out here.
How To Execute Hello World in C Programming?
- Create a new text document using gEdit text editor in Linux operating system.
- Copy any of the following hello world programs, and paste it into your text document.
- Save the document with a .c extension.
- Open the Linux terminal by using the shortcut command Ctrl + T.
- Locate to the .c document directory by using the cd command as shown in the output at the bottom.
- Since GCC is the default compiler in Linux, type gcc filename.c command.
- To run the object file, type ./a.out command and it’s going to display the output.
If you’re in Microsoft Windows environment, please download a C compiler and have fun with C programming.
Note: This C program to write hello world program is compiled with GNU GCC compiler on Linux Ubuntu 14.10 operating system.
Method 1: Display Hello World in C Programming
Method 2: Print Hello World C Program using Command Line Arguments
Method 3: C Program To Print Hello World using Strings
Method 4: C Program To Display Hello World using Macros
If you have any compilation errors or doubts about this C program to display hello world, let us discuss it in the comment section below.
Find more about Hello World program on Wikipedia.