C Program To Find Simple Interest
Simple interest is a quick method of calculating the interest charge on a loan. In this article, we will learn to calculate the simple interest in C programming language.
Simple interest is determined by multiplying the daily interest rate by the principal by the number of days that elapse between payments. Divide the product of these three values to convert the percentage value of the interest rate into decimals.
Simple Interest Formula
Where P is the principal amount, T is the time, and, R is the interest rate.
Simple Interest Program in C
C
#include <stdio.h>
int main()
{
float P = 1, R = 1, T = 1;
float SI = (P * T * R) / 100;
printf ( "Simple Interest = %f\n" , SI);
return 0;
}
|
OutputSimple Interest = 0.010000
Complexity Analysis
- Time Complexity: O(1)
- Auxiliary Space: O(1)
Last Updated :
21 Feb, 2024
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...