|
|
#2
rjsp2019-09-25 16:05
|
prints the interest payable per year for rates of interest from 5% to 12% in steps
of 0.5%.
#include <stdio.h>
int main (){
int y=0;
double m,r,i;
printf ("enter the amount of money : ");
scanf ("%lf",&m);
printf ("YEAR INTEREST\n\n");
for (r=0.05; r<=0.12; r+=0.005; y++)
i=m*r;
printf ("\n%d %6.2f",y,i);
}
[此贴子已经被作者于2019-9-25 17:55编辑过]
程序代码: