### Write a program in C Language to Calculate Simple Interest.

In this C Program we will learn how to make a program in C Language to Calculate Simple Interest. In this program take input principal, rate and time ( p, r , t) from user and find simple interest.

# Simple Interest Formula

Simple interest formula is given by.

Where,

P is the principal amount

T is the time and

R is the rate

SI is Simple Interest

# Logic to calculate simple interest

Step by step descriptive logic to calculate simple interest.

- Input principle amount in some variable say p.
- Input rate in some variable say r.
- Input time in some variable say t.
- Find simple interest using formula si = (p * r * t) / 100.
- Finally, print the resultant value of si.

# Program to Calculate Simple Interest

Here is source code of the C program to calculate simple interest. The C program is successfully compiled and run on Windows operating system. The program output is also shown below.

```
/* Calculate Simple Interest */
#include<stdio.h>
int main()
{
float p;
float r,t;
float si;
printf("Enter your principal amount : ");
scanf("%f",&p);
printf("\nEnter your rate of interest : ");
scanf("%f",&r);
printf("\nEnter time (in year) : ");
scanf("%f",&t);
si = (p * r * t) / 100;
printf("\nSimple Interest is : %.2f",si);
return 0;
}
```

### Output:

Enter your principal amount : 1000

Enter your rate of interest : 5

Enter time (in year) : 2

Simple Interest is : 100.00

### How Simple Interest program works?

- #include <stdio.h> includes the standard input output library functions. The
**printf()**and**scanf()**function is defined in stdio.h . - int
**main()**The**main()**function is the entry point of every program in c language. **float**is a data type in c language.**float**is used for decimal numbers p, r, t and si are variables. Variable is used for store data value.**printf()**The**printf()**function is used to print data on the console.**scanf()**The**scanf()**function is use to take input from keyboard.