# Calculate Simple Interest C Program

## C Program To Calculate Simple Interest

Learn How To Calculate Simple Interest in C Programming Language. We have enlisted Two different methods to Find Simple Interest and amount associated to it. The First method calculates Simple Interest without using Function and the Second method has a User – Defined Function to find the Simple Interest. Simple interest is basically a quick and easy calculation on the Interest charged on a given principal amount.

#### Formula To Find Simple Interest

**Simple Interest = (p * n * r) / 100**

**where**,

**p** = Principal Amount,

**n** = Number of Years / Period

**r** = Rate of Interest

This C Program takes the values of **p**, **n** and **r** from the user and then applies the above given mathematical formula for simple interest calculation.

**Must Read: C Program To Calculate Compound Interest using Functions**

#### Method 1: C Program To Find Simple Interest without Function

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include<stdio.h> int main() { float principal, period, rate; float si; printf("\nEnter Prinicpal Amount:\t"); scanf("%f", &principal); printf("\nEnter Period of Years:\t"); scanf("%f", &period); printf("\nEnter Rate of Interest:\t"); scanf("%f", &rate); si = (principal * period * rate)/100; printf("\nSimple Interest = %f\n", si); printf("\n"); return 0; } |

#### Method 2: C Program To Calculate Simple Interest using Function

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include<stdio.h> float interest_calc(float a, float b, float c); int main() { float principal, period, rate; float res; printf("\nEnter Prinicpal Amount:\t"); scanf("%f", &principal); printf("\nEnter Period of Years:\t"); scanf("%f", &period); printf("\nEnter Rate of Interest:\t"); scanf("%f", &rate); res = interest_calc(principal, period, rate); printf("\nSimple Interest = %f\n", res); printf("\n"); return 0; } float interest_calc(float a, float b, float c) { float si; si = (a * b * c)/100; return si; } |

**Must Read: C Program To Display Current Date and Time**

#### Output

In case you get any compilation errors in this C Program To Calculate Simple Interest or you have any doubts about it, let us know about it in the Comment Section below.

It’s a good thing because knowledge not only for self

Yes. Our main motive is to share whatever we know about Programming.

I will always prefer the Simple Interest using Function code in C Programming since it gives more modularity and resusability to the function.

I want to print 3 digits after the decimal point in the result. Can you help me with that?

Sure! Just use this format specifier to print the answer

%0.3f. This will get you the correct output.