Completed problem 11 in C