Adding solution for problem 35 in c.