My photo
Bangalore, Karnataka, India
Extending one hand to help someone has more value rather than joining two hands for prayer

Archives

calulate gain in amount by adding 11 % interst per year within 10 years

Tuesday, September 1, 2009

#include<stdio.h>
#include<conio.h>
#define interest 11
#define period 10
void main()
{
 clrscr();
 float amount=5000;
 int duration=0;
 while(duration<=period)
 {
  printf("%2d           %8.2f\n",duration,amount);
  amount=amount+amount*interest/100;
  duration++;
  }
  getch();
}

0 comments: