/* * Print headings and years for table showing interest accumulation. */ #include #include #define PRINCIPAL 5000.00 /* start with $5000 */ #define INTRATE 0.06 /* interest rate of 6% */ #define PERIOD 7 /* over 7-year period */ int main() { int year; /* year of period */ printf("Interest Rate: %7.2f%%\n", INTRATE * 100); printf("Starting Balance: $ %7.2f\n", PRINCIPAL); printf("Period: %7i years\n\n", PERIOD); printf("Year Balance\n"); year = 1; /* just print years */ while (year <= PERIOD) { printf("%4i\n", year); year = year + 1; } return EXIT_SUCCESS; /* assume program worked! */ }