Friday, October 4, 2013

WAP to calculate Simple and Compound Interest



#include <stdio.h>
#include <math.h>

int main()
{
   float p,r,t;
   float si,ci;
   printf(“Enter the value of p, r and t”);
   scanf(“%f%f%f”,&p,&r,&t);

   si=(p * r * t)/100;
   printf(“\n The Simple interest is %f”, si);
  

   ci=p*pow(1+(r/100),t);
   printf("\n The Compound interest is %f", ci);

   return 0;
}

No comments:

Post a Comment