#include<stdio.h>
#include<conio.h>
float
interest(float int_amt,float rate, int year);
void
main()
{
int int_amt,year;
float rate,amt;
clrscr();
printf("\n\n\t Enter the
Principle Amt.-> ");
scanf("%d",&int_amt);
printf("\n\n\t Enter the Rate of
Interest -> ");
scanf("%f",&rate);
printf("\n\n\t Enter the No. of
Years -> ");
scanf("%d",&year);
amt=interest(int_amt,rate,year);
printf("\n\n\t\tYour compound
Interest is %f",amt);
getch();
}
float
interest(float int_amt,float rate, int year)
{
float interest,amt,ci;
float i,j=1;
for(i=1; i<=year; i++)
{
j=(rate+100)/100*j;
}
interest=int_amt*j;
ci=int_amt+interest;
return ci;
}
No comments:
Post a Comment