C Program to Print Hello World

C Program to Print Hello World. You will learn how to print “Hello World” on the screen using c programming in this example. You should be familiar with the following c programming fundamentals in order to follow along with this example.

#include <stdio.h>
int main()
{
printf("Hello World");
return 0;
}

 

Output:

Hello World

C Program to Print Hello World

The stdio.h file includes functions to take input and display output, such as scanf() and printf(). The application will not compile if you use the printf() method without include stdio.h. printf() is a library function that displays formatted output. Printf() prints the text Hello World on the screen in this application.

Header File in C Program

A header file has the suffix. h and includes C function declarations and macro definitions that may be reused across several source files. The files that the programmer creates and the files that arrive with your compiler are the two sorts of header files. 

A header file’s main function is to ensure that declarations are propagated to code files. We can put declarations in one place and then import them anywhere we need them via header files. In multi-file apps, this may save a lot of typing.