Program To Calculate the Simple Interest - C Program

Program To Calculate the Simple Interest

#include<stdio.h>
 
int main() 
{
   int amount, time;
   float rate,si;
 
   printf("\nEnter Principal Amount : ");
   scanf("%d", &amount);
 
   printf("\nEnter Rate of Interest : ");
   scanf("%f", &rate);
 
   printf("\nEnter Period of Time   : ");
   scanf("%d", &time);
 
   si = (amount * rate * time) / 100;
   printf("\nSimple Interest : %f", si);
 
   return(0);
}

Output - Program To Calculate the Simple Interest

Enter Principal Amount : 5000                                                                                         
                                                                                                                      
Enter Rate of Interest : 2.8                                                                                          
                                                                                                                      
Enter Period of Time   : 4                                                                                            
                                                                                                                      
Simple Interest : 560.000000          
Compile and Run Online