Write a c program to print hello world

Write a  C program to print the 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

How to execute the hello world program in c

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.

What is header file in c program and its uses

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.