When we are saying Output that means to display some data on screen, printer or in any file. C programming language provides a set of built-in functions to output the data on the computer screen as well as you can save that data in text or binary files.
C programming language treats all the devices as files. So devices such as the display are addressed in the same way as files and following three file are automatically opened when a program executes to provide access to the keyboard and screen.
|Standard File||File Pointer||Device|
|Standard error||stderr||Your screen|
The file points are the means to access the file for reading and writing purpose. This section will explain you how to read values from the screen and how to print the result on the screen.
getchar() & putchar() functions
The int putchar(int c) function puts the passed character on the screen and returns the same character. This function puts only single character at a time. You can use this method in the loop in case you want to display more than one character on the screen.
gets() & puts() functions
The int puts(const char *s) function writes the string s and a trailing newline to stdout.
scanf() & printf() functions
The int printf(const char *format, ...) function writes output to the standard output stream stdout and produces output according to a format provided.
The format can be a simple constant string, but you can specify %s, %d, %c, %f etc to print or read strings, integer, character or float respectively. There are many other formatting options available which can be used based on requirements. For a complete detail you can refer to a man page for these function.