First Program in C

Hello world program in C programming. In this tutorial, you will learn how to write the hello world program in C programming language using different ways.

Hello World Program

The following program printing Hello World! on the output screen.

Program

#include<stdio.h>
#include<conio.h>
void main()
{
printf("Hello World!");
getch();
}
Output
Hello World!

Hello World Examples

The following program also printing Hello World in one line on the output screen.

Program

#include<stdio.h>
#include<conio.h>
void main()
{
printf("Hello");
printf("World!");
getch();
}
Output
HelloWorld!

The following program printing Hello World in two lines on the output screen.

Program

#include<stdio.h>
#include<conio.h>
void main()
{
printf("Hello \nWorld!"); //\n used for goto New Line
getch();
}
Output
Hello
World!

The following program also printing Hello World in two lines on the output screen.

Program

#include<stdio.h>
#include<conio.h>
void main()
{
printf("Hello \n");
printf("World!");
getch();
}
Output
Hello
World!