In the previous chapters we have learnt how variables can be declared and initialized, what are the different operators available in C and using these operators how a meaningful expression can be written. Now, we will discuss how the input and output operations are carried out in C.
C language does not have any input or output statement. All the input and output operations are accomplished using some library functions. These are included in stdio.h and conio.h header files. These input and output functions or in short, I/O functions are categorized into three groups. These are:
1. Console I/O functions which deal with keyboard and monitor,
2. Disk I/O functions which deal with hard disk or floppy disk and
3. Port I/O functions which deal with different port.
In this chapter, we will discuss only about some console I/O functions that are used frequently. These console I/O functions can be categorized into formatted I/O functions and unformatted I/O functions.
FORMATTED I/O FUNCTIONS
Formatted input refers to read or input data using keyboard in a particular format and formatted output refers to print or display (i.e., output) data or message in the VDU in a formatted way means when a set of values will be displayed, the sequence of the fields, their widths, spaces among the values, etc. can be specified. The standard library function scanf( ) is used for formatted input operation and printf( ) is used for formatted output operation.
Review the options below to login to check your access.
Log in with your Cambridge Aspire website account to check access.
If you believe you should have access to this content, please contact your institutional librarian or consult our FAQ page for further information about accessing our content.