Answer to Question #153193 in C for Kranthi

Question #153193

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%.


1
Expert's answer
2021-01-04T03:37:00-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS