C Program to Print “Hello World”

The following C program displays “Hello World” in the output.

C




// Simple C program to display "Hello World"
 
// Header file for input output functions
#include <stdio.h>
 
// main function -
// where the execution of program begins
int main()
{
 
    // prints hello world
    printf("Hello World");
 
    return 0;
}


Output

Hello World

C Hello World Program

To begin with, the “Hello World” program is the first step towards learning any programming language and also one of the simplest programs you will learn. All one needs to do is display the message “Hello World” on the screen. Let’s look at the program and try to understand the terminologies involved in it.

Similar Reads

C Program to Print “Hello World”

The following C program displays “Hello World” in the output....

Compiling the First C Program

...

Explanation of the Code

Before proceeding to write the first program, the user needs to set up a C program compiler, which would compile and execute the “Hello World” program. Here we have used a Windows-based GCC compiler to compile and run the program. To know more on how to set up the local GCC compiler or run using online ide refer to Setting C Development Environment....