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
Chitra
Chitra

3 thoughts on “Program to calculate a simple interest

Leave a Reply

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

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in