Code for problem 78C.