C language
Two commonly used functions for I/O (Input/Output) are printf() and scanf().
C Output
#include <stdio.h> //This is needed to run printf() function.
int main()
{
printf("C Programming"); //displays the content inside quotation
return 0;
}
Output
C Programming
How this program works?
- All valid C program must contain the
main()
function. The code execution begins from the start ofmain()
function. - The
printf()
is a library function to send formatted output to the screen. Theprintf()
function is declared in"stdio.h"
header file. - Here,
stdio.h
is a header file (standard input output header file) and#include
is a preprocessor directive to paste the code from the header file when necessary. When the compiler encountersprintf()
function and doesn't findstdio.h
header file, compiler shows error. - The
return 0;
statement is the "Exit status" of the program. In simple terms, program ends.