Adding solution for problem 46 in c.