Completed problem 19 in C