Sams Teach Yourself C in 21 Days

(singke) #1

DAY 7


WEEK 1


Fundamentals of Reading


and Writing Information


In most programs you create, you will need to display information on the
screen or read information from the keyboard. Many of the programs presented
in earlier lessons have performed these tasks, but you might not have under-
stood exactly how. Today you will learn:


  • The basics of C’s input and output statements

  • How to display information on-screen with the printf()andputs()
    library functions

  • How to format the information that is displayed on-screen

  • How to read data from the keyboard with the scanf()library function
    Today’s lesson isn’t intended to be a complete treatment of these topics, but it
    provides enough information so that you can start writing real programs. These
    topics are covered in greater detail later in this book.


11 448201x-CH07 8/13/02 11:20 AM Page 147

Free download pdf