Made a C program to study problem 6.38.