-
Notifications
You must be signed in to change notification settings - Fork 7
/
simple_intrest.c
31 lines (21 loc) · 944 Bytes
/
simple_intrest.c
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
27
28
29
30
31
// This is the program to calculate the simple interest rate .
/* Sample Input :
Enter the principle amount : 1000
Enter the interest rate: 12
Enter the time period : 2
Sample Output :
The simple_interest is : 240.0000
*/
#include <stdio.h>
void main()
{
float principle , interest , time , simple_interest ; // Variable declaration
printf("Enter the principle amount :");
scanf("%f",&principle); // Input Principle
printf("Enter the interest rate:");
scanf("%f",&interest); // Input interest
printf("Enter the time period :");
scanf("%f",&time); // Input time
simple_interest = (principle * interest * time)/100 ; // Calculation of Simple interest
printf(" The simple_interest is : %f",simple_interest); // Output
}