Check The Programming Section
Unformatted Input/Output functions are the most basic form of input/output. Unformatted input/output functions do not require any format specifier to convert any data in ASCII character representation like formatted I/O functions do. Unformatted I/O functions such as getchar(), putchar(), gets() are capable to take input or write the output for char and string data types only. Unformatted I/O functions can not take more than one value as input and neither writes multiple outputs using one function. For example,
char ch = getchar(); //taking one character as input
putchar(ch); //writes only one data as output to the console
On the other side, formatted I/O functions convert the internal binary representation of the data to ASCII characters which are written to the output file and for each type of value a specific format specifier needs to be used. Such as %d for decimal values, %c for character values. Formatted functions such as scanf(), can take input multiple data values using one function. Similarly, printf() can write multiple outputs to the console at the same time. For example,
scanf(“%d %d”, &num1, &num2); //taking input two data values
printf(“%d %d”, num1, num2); //writes multiple values to console