Code for problem 55C.