Every C program performs three main functions i.e. it accepts data as input, processes data and produces output. Input refers to accepting of data while output refers to the presentation of data.

Normally input is accepted form keyboard and output is displayed to screen. Input output operations are most common task in every programming language.

C languages has different type of input output functions for input-output operations. Out of different input output operations, in this section, we mainly focus on formatted and unformatted input output functions.

1. Formatted Input Output Functions

Formatted input output functions accept or present the data in a particular format. The standard library consists of different functions that perform output and input operations.

Out of these functions, printf() and scanf() allow user to format input output in desired format. printf() and scanf() can be used to read any type of data (integer, real number, character etc.).

  1. printf()
  2. scanf()

2. Unformatted Input Output Function

Unformatted input output functions cannot control the format of reading and writing the data. These functions are the most basic form of input and output and they do not allow to supply input or display output in user desired format that's why we call them unformatted input output functions.

Unformatted input output functions are classified into two categories as character input output functions and string input output functions.

Character input functions are used to read a single character from the keyboard and character output functions are used to write a single character to a screen. getch(), getche(), and getchar() are unformatted character input functions while putch() and putchar() are unformatted character output functions.

  1. getch()
  2. getche()
  3. getchar()
  4. putch()
  5. putchar()