Adding solution for problem 37 in c.