#include <stdio.h>
#include <math.h>
#define MAX_INTEREST 6
#define MAX_PERIOD 10
int main()
{
int interest;
float fvif;
printf("/nRate of interest varies from 1% to 6%.");
printf("/nPeriod varies from 1 year to 10 years.");
printf("/n/n Interest Rate ");
printf("/nPeriod");
for (int i=1; i<= MAX_INTEREST; i++){
printf("/t %d%", i);
}
for(int years=1; years <= MAX_PERIOD; years++) {
printf("%d/t", years);
for(interest=1; interest <= MAX_INTEREST; interest++) {
fvif = pow((1+interest*0.01), years);
printf("%6.3f/t", fvif);
}
printf("/n");
}
return 0;
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266695.html