
Lesson 9-5: Debugging
Scope, Lifetime, and More on Functions | 217
Name __________________________________________ Date _______________________
Section _________________________________________
Exercise 1: Function Swap takes two values as input and returns them in reverse order. This little
utility routine is very useful, but it doesn’t seem to work correctly. Can you fix it? Program
Driver is written to test function Swap. A program whose only purpose is to test a subprogram is
called a driver. The driver reads in two values, calls Swap with the two input values, and writes out
the result. Run Driver using 10 and 15 as the input values. What is printed? ...