Example of printf
In this example, we are printing the string “Hello Geek!” in the output using printf() function. In printf() function what we will write inside the double quotes (” “) is printed in the output.
C
// C program to illustrate the use of printf function #include <stdio.h> int main() { // using printf to print "Hello Geek!" printf ( "Hello Geek!" ); return 0; } |
Hello Geek!
printf in C
In C language, printf() function is used to print formatted output to the standard output stdout (which is generally the console screen). The printf function is a part of the C standard library <stdio.h> and it can allow formatting the output in numerous ways.