You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int main() {
float principal, rate, time, simpleInt, compoundInt;
printf("Enter the principal amount: ");
scanf("%f", &principal);
printf("Enter the rate of interest: ");
scanf("%f", &rate);
printf("Enter the time period in years: ");
scanf("%f", &time);
// Calculate simple interest
simpleInt = (principal* rate*time)/100;
printf("calculate simple intrest:");
// Calculate compound interest
int n,
printf("Enter the number of times Intrest is compounded per year:");
scanf("%d",& n);
compoundInt =principal*power((1+rate/(n*100) ), (n*time) )- principal
// Display the results
printf("\nSimple Interest: %.2f\n", simpleInt);
printf("Compound Interest: %.2f\n", compoundInt);
return 0;
}
The text was updated successfully, but these errors were encountered:
include <stdio.h>
int main() {
float principal, rate, time, simpleInt, compoundInt;
}
The text was updated successfully, but these errors were encountered: