Workshop ............................................................................................................
The Workshop provides quiz questions to help you solidify your understanding of the
material covered and exercises to provide you with experience in using what you’ve
learned.
Quiz ..............................................................................................................
- What is a stream, and what does a C program use streams for?
- Are the following input devices or output devices?
a. Printer
b. Keyboard
c. Modem
d. Monitor
e. Disk drive - List the five predefined streams and the devices with which they are associated.
- What stream do the following functions use?
a.printf()
b.puts()
c.scanf()
d.gets()
e.fprintf() - What is the difference between buffered and unbuffered character input from
stdin? - What is the difference between echoed and unechoed character input from stdin?
- Can you “unget” more than one character at a time with ungetc()? Can you
“unget” the EOFcharacter? - When you use C’s line input functions, how is the end of a line determined?
- Which of the following are valid type specifiers?
a.“%d”
b.“%4d”
c.“%3i%c”
d.“%q%d”
e.“%%%i”
f.“%9ld” - What is the difference between stderrandstdout?
374 Day 14
22 448201x-CH14 8/13/02 11:12 AM Page 374