Simple Interest is the interest calculated only on the original principal amount, without adding the earned interest back to the principal.
- It is calculated on the principal amount for the entire period.
- The interest earned is not added to the principal amount for future calculations.
Examples
Input: Principal = 1000, Rate = 5, Time = 2
Output: Simple Interest = 100Input: Principal = 2000, Rate = 3.5, Time = 4
Output: Simple Interest = 280
Finding Simple Interest
To find the simple interest in the C programming language, we can directly implement the simple interest formula with the required values such as rate, time, and principal amount as input since there is no built-in C function to calculate it directly.
Simple Interest Formula
Simple Interest = Principal * Rate * Time / 100
#include <stdio.h>
int main() {
// Input values
float P = 1, R = 1, T = 1;
// Calculate simple interest
float SI = (P * T * R) / 100;
// Print Simple Interest
printf("Simple Interest = %f\n", SI);
return 0;
}
Output
Simple Interest = 0.010000
Simple Interest Calculator Using Function
We can also define a function name smpInt() that takes rate, time and principle as arguments at returns the simple interest. It is more convenient when we need to find the simple interest frequently.
#include <stdio.h>
// Function to calculate simple interest
float smpInt(float p, float r, float t) {
return (p * r * t) / 100;
}
int main() {
// Input values
float P = 10000, R = 12, T = 1, SI;
// Call function to calculate simple interest
SI = smpInt(P, R, T);
// Display the result
printf("Simple Interest: %.2f\n", SI);
return 0;
}
Output
Simple Interest: 1200.00