Adding solution for problem 19 in c.