Program to Find Simple Interest in C
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;
}
Explanation
amountstores the principal amount.periodstores the time in years.ratestores the rate of interest.- The formula
(amount * period * rate) / 100calculates the simple interest. %.2fdisplays the result up to 2 decimal places.