output

printf is a function to print formatted output to the standard output, stdout. The printf function is part of the C standard library, <stdio.h>. printf can be used to format output in different ways.

prinf ( "formatted_string", arguments_list);
  • parameters

formatted string is a string that specifies the data to be printed. It can also contain a format specifier to print the value of any variable (such as character and an integer).

argument list is the variable names corresponding to the format specifier.

  • return value

printf returns the number of characters printed after the successful execution.

If an error occurs, a negative value is returned.

#include <stdio.h>
 
int main()
{
    printf("Hello World");
 
    return 0;
}