Adding solution for problem 48 in c.