# C Program to Calculate Simple Interest

C program to calculate simple interest; In this tutorial, i am going to show you how to calculate simple interest in c program using function and normal formula.

## Algorithm and Programs to Calculate Simple Interest in C

• Algorithm to Calculate Simple Interest
• C Program to Calculate Simple Interest using Formula
• C Program to Calculate Simple Interest using Function

### Algorithm to Calculate Simple Interest

Follow the below given algorithm to write a program to calculate simple interest; as follows:

• Get input principle amount and store in some variable.
• Get input time and store in some variable..
• Get input rate and store in some variable..
• To calculate simple interest using formula `SI = (principle * time * rate) / 100`.
• Finally, print the result of simple interest.

### C Program to Calculate Simple Interest using Formula

```/**
* C program to calculate simple interest
*/
#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;
}```

The result of the above c program; as follows:

```Enter principle (amount): 10000
Enter time: 1.5
Enter rate: 5
Simple Interest = 750.000000```

### C Program to Calculate Simple Interest using Function

```/**
* C program to calculate simple interest
*/
#include <stdio.h>
// function for finding simple interest
float SimpleInt(float p, float r, float t)
{
float si;
si = (p * r * t)/100; // formula
return si; // returning yhe value of si
}
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);
/* Call function with paramters to Calculate simple interest */
SI = SimpleInt(principle, rate, time);
/* Print the resultant value of SI */
printf("Simple Interest = %f", SI);
return 0;
}```

The result of the above c program; as follows:

```Enter principle (amount): 20000
Enter time: 2
Enter rate: 5
Simple Interest = 2000.000000```