Print “Hello World” without using any header file in C


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,

Example Code

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

Output

Hello World

n 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, ...);

Updated on: 30-Jul-2019

821 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements