Adding solution for problem 36 in c.