Adding solution for problem 20 in c.