C Program to Calculate Simple Interest

In this example, we will calculate simple interest. For calculating simple interest formula given below

Program to calculate Simple Interest in C

#include<stdio.h>
void main()
{
  int p,r,t;
  float si;
  printf("Enter principal amount");
  scanf("%d",&p);
  printf("Enter rate of interest");
  scanf("%d",&r);
  printf("Enter Time in years");
  scanf("%d",&t);
  si = ( p*r*t ) / 100;
  printf("Simple Interest = %.2f",si);
}
  

Output

Enter principal amount
50000
Enter rate of interest
12
Enter time
3
Simple Interest = 18000.00
Share in a Single Click

Leave a Reply

Your email address will not be published. Required fields are marked *