Simple interest
Simple interest is a simple way to calculate the interest on a loan. Simple interest is determined by multiplying the principal by the daily interest rate multiplied by the number of days elapsed between payments. – Investopedia
Logic
After taking the input (Principle, Rate, Time) from the user we have to use a very simple formula shown below:
Simple interest formula
Where, P = Principle, T = Time and R = Rate
To calculate simple interest we have to multiply the principal, rate and time, then divide it by 100 and print the result.
Program
#include<stdio.h> int main() { float principal, rate, time, result; printf("Enter principal : "); scanf("%f", &principal); printf("\nEnter rate : "); scanf("%f", &rate); printf("\nEnter time (year) : "); scanf("%f", &time); // Calculate simple interest result = (principal * rate * time) / 100; printf("\nSimple interest : %f", result); return 0; }
Output
Enter principal : 1000
Enter rate : 4
Enter time (year) : 2
Simple interest : 80.000000