Print “Hello World” in C/C++ without using header files

Generally, we use header files in C/C++ languages to access the built-in functions like int, char, string functions. The function printf() is also a built-in function which is declared in “stdio.h” header file and it is used to print any kind of data on console.

Here is an example to print without header files in C language,


int printf(const char *text, ...);
int main() {
   printf( "Hello World" );
   return 0;


Hello World

In the above program, we printed “Hello World” without using any header file in the program by declaring the printf() function. The declaration of printf() is as follows.

int printf(const char *text, ...);
Samual Sam
Samual Sam

Learning faster. Every day.