"printf()" statement :
“printf()” is a C library function from the header file “stdio.h”(stdio – standard input output), which sends the console output to stdout.
Example :
#include<stdio.h>
int main()
{
printf(“Hello!”); // this printf function will print “Hello!” as the output.
return 0;
}
Hello!
“printf()” returns the number of printed characters, that is an integer value.
Let’s see this through an example:
#include<stdio.h>
int main()
{
int P = printf(“Hello World!\n”);
printf(“%d”,P);
return 0;
}
Hello World!
13
Explanation:
Here we have declared a integer variable “P” which prints “Hello World!” in the first line. Now we are printing the value of variable “P”. Here the space between “Hello” and “World” is treated as an “\o” character. Therefore the number of total character is 12 in the string “Hello’\o’World!”, and including “\n”, there is total number of character is 13.