write a program which request a user to enter an amount of money .the program prints the intrest payable per year for rates of interest from 5%to 12% in steps of 0.5%.
#include <stdio.h>
int main() {
double amount = 0;
int years = 0;
int counter = 0;
printf("Enter an amount of money:\n");
scanf("%lf", &amount);
printf("Enter a number of years: \n");
scanf("%d", &years);
while (counter < years){
amount += amount*0.005;
printf("year %d - %lf\n", &years, &amount);
counter ++;
}
return 0;
}
Comments
Leave a comment