Added C and C++ solutions to problem 9.