C Program To Find Simple Interest
Last Updated :
23 Jul, 2025
Write a C program to find the simple interest.
Simple Interest is the interest paid on the principal amount for which the interest earned regularly is not added to the principal amount.
Examples
Input: Principal = 1000, Rate = 5, Time = 2
Output: Simple Interest = 100
Input: Principal = 2000, Rate = 3.5, Time = 4
Output: Simple Interest = 280
How to Find Simple Interest in C?
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
Simple Interest Program in C
C
// C program to find the simple interest
#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;
}
OutputSimple Interest = 0.010000
Time Complexity: O(1)
Auxiliary Space: O(1)
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.
C
// C Program to Calculate Simple Interest using Functions
#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;
}
OutputSimple Interest: 1200.00
Time Complexity: O(1)
Auxiliary Space: O(1)
Explore
C Basics
Arrays & Strings
Pointers and Structures
Memory Management
File & Error Handling
Advanced Concepts