Dark mode logo
Last Updated:
Display hello world in c

C Program to display Hello World

Algorithm

output: Display Hello World in the console

  1. Start
  2. Print Hello World
  3. Stop

C Program

 

#include <stdio.h>
int main( )
{
    printf("Hello World\n");
    return 0;
}
 
 
Note: This Program was created using visual studio code. The Program file can be downloaded by clicking here

 

Explanation

This is a simple program, altho I will explain these too. The #include <stdio.h> is used to include a library in C. Now you may ask, what is a library? In simple words, a library contains the code for several functions. And <stdio.h> contains the code for standard input and standard output, such as printf and scanf.

The int main() indicates that the main function has started. The printf () is used to print something to the console window. In this case Hello world. The printf () can also print numbers.  Since we used int main() we need to return some value back to the function. If we had used void main(), we need not have had to return a value. More on this will be explained later.

Comments