Friday, 4 May 2012

Compound Interest in C

#include<stdio.h>
#include<math.h>
main()
{
 float p,n,r,i,f;
 printf("Enter Principal, Rate and Years:\n");
 scanf("%f%f%f",&p,&r,&n);
 i=r/100;
 f=p*pow((1+i),n);
 printf("The final value is = %f",f);
 getch();
}

No comments:

Post a Comment