Saturday, July 24, 2010

Compound Interest

This program gives compound interest.


#include
int main()
{
int count=0, a=1, n, v;
float g, h;
printf ("This program gives compound interest\n");
printf ("Enter the rate of interest your bank gives:\n");
scanf ("%f", &g);
printf ("How much money have you put in that bank:\n");
scanf ("%f", &h);
printf ("For how many years:\n");
scanf ("%d", &n);
while (n>count){
++count;
h=((g/100)*h)+h;
}
printf ("Your money has amounted to %f\n", h);
return 0;
}

No comments:

Post a Comment