"The C Programming Language", 2nd edition, Kernighan and Ritchie

Answers to Exercises

Chapter 7 - Input and Output


Ex No Pg No Exercise Solution Solved by
1 153 Write a program that converts upper case to lower or lower case to upper, depending on the name it is invoked with, as found in argv[0]. Listing krx701 Richard Heathfield, Bryan Williams
2 155 Write a program that will print arbitrary input in a sensible way. As a minimum, it should print non-graphic characters in octal or hexadecimal according to local custom, and break long text lines. Listing krx702 Me
3 156 Revise minprintf to handle more of the facilities of printf . Listing krx703 Gregory Pietsch
4 159 Write a private version of scanf analogous to minprintf from the previous section. No solution yet posted. ----
5 159 Rewrite the postfix calculator of Chapter 4 to use scanf and/or sscanf to do the input and number conversion. No solution yet posted. ----
6 165 Write a program to compare two files, printing the first line where they differ. Listing krx706 "flippant_squirrel"(!)
7 165 Modify the pattern finding program of Chapter 5 to take its input from a set of named files or, if no files are named as arguments, from the standard input. Should the file name be printed when a matching line is found? No solution yet posted. ----
8 165 Write a program to print a set of files, starting each new one on a new page, with a title and a running page count for each file. Listing krx708 Steven Huang
9 168 Functions like isupper can be implemented to save space or to save time. Explore both possibilities. Listing krx709 Gregory Pietsch


Back
Home




You are visitor number - call again soon!