PRINTF
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 defined inside <stdio.h> header file.
printf("format_string", args...);
Parameter:
- formatted_string: It is a string that specifies the data to be printed. It may also contain a format specifier as a placeholder to print the value of any variable or value.
- args...: These are the variable/values corresponding to the format specifier.
Return Value:
- Returns the number of characters printed after successful execution.
- If an error occurs, a negative value is returned.
#include <stdio.h>
int main()
{
/*Using printf to print the text "Hi!"*/
printf("Hi!");
return 0;
}
Output Hi!
Explanation: In this program, the printf function print the text "Hi!" on the console screen.
gcc -Wall -Werror -Wextra -pedantic -std=gnu89 -Wno-format *.c
The man page of the function _printf() is man_3_printf
@tomproux https://github.com/tomproux
@arthurmoulard https://github.com/arthurmoulard