C Program to Calculate Simple Interest

Calculate simple Interest in C: To calculate simple interest below is the Formula.

Formula: 

SI = P * T * R / 100

Where SI = Simple Interest.
P = Principe amount.
T = time.
R = Rate of interest.

Calculate Simple Interest Program in C
#include<stdio.h>
int main()
{
 float p;
 float interest, time;
 float in;
  printf("Type your principle amount = ");
  scanf("%f",&p);
  printf("\n Type your rate of interest = ");
  scanf("%f",&interest);
  printf("\n Type time in year = ");
  scanf("%f",&time);
  in=p*interest*time/100;
  printf("\n You will get interest = %.2f",in);
 return 0;
}
Output:
Type your principle amount =  100000
Type your rate of interest = 10
Type time in year = 10
You will get interest = 100000.00
Explanation:
  • The First Four data types are declared p, interest, time, in of type Float.
  • The values of p, interest, time is taken from the keyword.
  • The result of (p*interest*time)/(100) stored in the value of in.
See also:
Share:

Ads

Search This Blog

  • ()
Powered by Blogger.

Strings in C With Syntax, C String Program with output

Strings in C :  Strings can be defined as the one-dimensional array of characters terminated by a null ('\0'). The difference betwee...

Blog Archive