Calculate Simple Interest in C

C Program to Calculate Simple Interest

Source code :

#include <stdio.h>

int main(){
    
int amount,
    rate,
    time,
    interest;

printf("Enter the principal amount : ");
fflush(stdout);
scanf("%d", &amount);

printf("\nEnter the rate of Interest : ");
fflush(stdout);
scanf("%d", &rate);

printf("\nEnter the period of time : ");
fflush(stdout);
scanf("%d", &time);

interest = ( amount * rate * time ) / 100;

printf("\nSimple Interest : %d",interest);


return 0;

}

Output :

Enter the principal amount : 1000
Enter the rate of Interest : 2
Enter the period of time : 12
Simple Interest : 240

Algorithm :

  1. Get the Principal Amount, Rate and Time from the user
  2. Calculate Simple Interest using the formula ( amount * rate * time ) / 100
  3. Print the Interest

Output :


                

Comments :