Write a program to calculate the compound interest.
Answers
Answered by
4
Answer:
try this one..........
Attachments:
Answered by
2
Answer:
Write a program to calculate the compound interest.
Explanation:
#include <stdio.h>
#include <math.h>
int main()
{
float principal, rate, time, CI;
/* Input principle, time and rate */
printf("Enter principle (amount): ");
scanf("%f", &principle);
printf("Enter time: ");
scanf("%f", &time);
printf("Enter rate: ");
scanf("%f", &rate);
/* Calculate compound interest */
CI = principle* (pow((1 + rate / 100), time));
/* Print the resultant CI */
printf("Compound Interest = %f", CI);
return 0;
}
Output:-
Enter principle (amount): 1200
Enter time: 2
Enter rate: 5.4
Compound Interest = 1333.099243
Similar questions