You haven't included header file stdio.h
you can include this by #include<stdio.h>
A header file contains forward declarations of functions and variables. Every external function will be mentioned in a header file, including libraries that are pre-compiled into object code, and source files required to build the C program
what you need to so is thanks to the #include
line, which tells it where the definition of printf can be found.
#include<stdio.h>
main()
{
printf("Hi\n");
}
check The Header File
and printf=> void printf (const char *format, ...);
and now explanation of above program
in line first
#
=> it is Processors the preprocessor
is a translation phase that is applied to your source code before the compiler proper gets its hands on it
recomended reading C - Pre-Processors
main()
function => the main function is where a program starts execution. It is responsible for the high-level organization of the program's functionality, and typically has access to the command arguments given to the program when it was executed.
printf()
is nearly full implementation of standard ANSI C printf
function, which sends the formatted output to the screen in terminal (TTY) mode. this is belongs to stdio.h
header file
good read wikipedia article and Where are C/C++ main function's parameters?