Formula:
Simple Interest = (Amount × Period × Rate) / 100
#include <stdio.h>
int main()
{
float amount, period, rate, simpleInterest;
printf(“Enter the amount: “);
scanf(“%f”, &amount);
printf(“Enter the period in years: “);
scanf(“%f”, &period);
printf(“Enter the rate of interest: “);
scanf(“%f”, &rate);
simpleInterest = (amount * period * rate) / 100;
printf(“Simple Interest = %.2f”, simpleInterest);
return 0;
}
amount stores the principal amount.period stores the time in years.rate stores the rate of interest.(amount * period * rate) / 100 calculates the simple interest.%.2f displays the result up to 2 decimal places.This website uses cookies.