Code for problem 15C.