Home Segments Index Top Previous Next

412: Practice

Now assume you have learned that interest is actually compounded monthly, which makes the equivalent annual interest rate different from 12 times the monthly interest rate. Revise the readers and writers that you were asked to devise in Segment 411 to accommodate monthly compounding. You will need to include the line #include <math.h> in your program, because that line allows you to use the library function, pow. The pow function takes two arguments, x and y, both of type double, and computes xy.