Adding solution for problem 26 in c.