Added problem 2 solutions in C