Adding solution for problem 34 in c.