Skip to content

Commit 4036926

Browse files
authored
Create interest.c
initial
1 parent c5c05c2 commit 4036926

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

interest.c

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* C program to calculate simple interest
3+
*/
4+
5+
#include <stdio.h>
6+
7+
int main()
8+
{
9+
float principle, time, rate, SI;
10+
11+
/* Input principle, rate and time */
12+
printf("Enter principle (amount): ");
13+
scanf("%f", &principle);
14+
15+
printf("Enter time: ");
16+
scanf("%f", &time);
17+
18+
printf("Enter rate: ");
19+
scanf("%f", &rate);
20+
21+
/* Calculate simple interest */
22+
SI = (principle * time * rate) / 100;
23+
24+
/* Print the resultant value of SI */
25+
printf("Simple Interest = %f", SI);
26+
27+
return 0;
28+
}

0 commit comments

Comments
 (0)