Program to calculate a simple interest

Here is the program to calculate a simple interest

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "stdio.h"
#include "conio.h"
 
void main()
{
  float principal,rate,time;
  float simpleInterest;
  printf("\nEnter the principal amount ");
  scanf("%f",&principal);
  printf("\nEnter the rate of interest ");
  scanf("%f",&rate);
  printf("\nEnter the time duration ");
  scanf("%f",&time);
  simpleInterest=(principal*rate*time)/100;
  printf("\nThe simple interest is %f",simpleInterest);
getch();
}

Output:

Enter the principal amount 50000
Enter the rate of interest 5
Enter the time duration 2
 
The simple interest is 5000

4 Responses to “Program to calculate a simple interest”

  1. Frank Isack

    //This program is for finding The simple iterest
    #include
    main()
    {
    int P,R,T;
    int A ;
    printf(“Enter the value of P,R and T \n”);
    scanf(“%d %d %d”,&P,&R,&T);
    A = (P*R*T)/100;
    printf(“The simple interest is %d”, A);
    }

    Reply
  2. Sahban khan

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

    printf(“\nEnter Principal Amount : “);
    scanf(“%d”, &amount);

    printf(“\nEnter Rate of Interest : “);
    scanf(“%d”, &rate);

    printf(“\nEnter Period of Time : “);
    scanf(“%d”, &time);

    si = (amount * rate * time) / 100;
    printf(“\nSimple Interest : %d”, si);

    return(0);
    }

    Reply

Leave a Reply