CHAPTER

3

Input and Output

3.1 Input and Output Functions

3.2 File Input and Output

3.3 Field Width Specification

3.4 Input and Output of Characters

3.5 Sample Programs

Chapter Summary

Exercises

Objectives

To learn the use of the instructions that move data in and out of the computer memory. To learn the design of readable data.

Input means providing the information or data the program needs for computation, and output means displaying, printing, or writing to a data file the computed results or the data the program produces. C provides various functions to input the data to the program and various functions to output the data from a program. The following sections present these functions.

3.1 Input and Output Functions

In C, data input ...

Get C Programming for Scientists and Engineers with Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.