Code for problem 30B.
Code for problem 30C.