5 Preprocessor Directives

Chapter 6
Input and Output
You have already seen the printf() function, which prints values to the screen. In this chapter, you'll learn many of the options available with printf(). In addition to output, your programs become much more powerful if you learn how to get input from the keyboard. The scanf() is a function that mirrors printf(). Instead of sending output values to the screen, scanf() accepts values that the user types at the keyboard.
printf() is your basic screen output function, and scanf() is your basic keyboard input function. printf() and scanf() offer beginning C programmers output and input functions they can use with relative ease. Both of these functions are limited especially scanf() but they do enable your programs to send output and to receive input.
This chapter teaches you the following topics:
The printf() function and its optional arguments
Control strings
Conversion characters
Modifying conversion characters
The scanf() function

 



C by Example
C by Example
ISBN: 0789722399
EAN: 2147483647
Year: 1999
Pages: 43
Authors: Greg Perry

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net