Problem 51 in C