3D - 2

Please help me fix this c program---thanks?

okey...this program works properly,, all i need is to organize my results... let it display. the compound interest with the rate being __is: and so on.. please help. #include <stdio.h> #include <math.h> int main(void) { double amount; double principal=1000.0; double rate= .05; int year; int six_percent; printf("%4s%21s\n", "year", "Amount on deposit"); for(year=1 ;year<=10 ; year++) for(rate=.05; rate<=0.10; rate+=.01) { amount=principal * pow(1.0 +rate ,year); printf("%4d%21.2f\n"year,amount); } } the program needs to display the compound interest using 5%,6%,7%,8%,9%,10% as the rate. the questions specifies that i must use a for loop..

Public Comments

  1. I don't know if it's the only problem, but you need a comma in the printf statement between the second " and the year variable.
  2. dude why dont you just not set the rate standards and have it loop right then in one of you printf statements ask the user t enter the following rates such as 5 6 7 8 9 and 10
Powered by Yahoo! Answers