In this tutorial, you’ll learn How to Calculate Simple Interest in C Programming.
Simple interest is a quick method to calculate the interest charge on a loan. To Calculate Simple interest is determined by multiplying the daily interest rate by the principal by the number of days that elapse between payments.
Simple Interest formula
The formula for simple interest is given by – simple interest = principle x rate x time / 100
P is the principal amount
T is the time and
R is the rate
The logic to calculate a simple interest
Step by step descriptive logic to calculate simple interest –
- Input principle amount in some variable says principle.
- Input time in some variable says time.
- Input rate in some variable says rate.
- Now, apply the formula to calculate simple interest i.e. SI = (principle * time * rate) / 100.
- Finally, print the resultant value of SI.
Program to calculate the simple interest
[sourcecode language=”plain”]
#include <stdio.h>
int main()
{
float principle, time, rate, SI;
/* Input principle, rate and time */
printf("Enter principle (amount): ");
scanf("%f", &principle);
printf("Enter time: ");
scanf("%f", &time);
printf("Enter rate: ");
scanf("%f", &rate);
/* Calculate simple interest */
SI = (principle * time * rate) / 100;
/* Print the resultant value of SI */
printf("Simple Interest = %f", SI);
return 0;
}[/sourcecode]
Output:
Related C Programs
- C program for prime number
- C program for factorial
- C Program to Compute Quotient and Remainder
- C Program to Find ASCII Value of a Character
Ask your questions and clarify your/others doubts on C Program to Calculate the Simple Interest by commenting. Documentation