C program Compound interest using simple interest

This program calculates the  Compound interest using simple interest function. This is a part of Mumbai University MCA Colleges C Program MCA Sem 1


#include<stdio.h>
#include<conio.h>
double simpint(double,double);
void main()
{
double p,amt,r,n;
int i;
clrscr();
printf("Enter the principle amount\n");
scanf("%lf",&p);
printf("Enter the rate of interesnt\n");
scanf("%lf",&r);
printf("Enter the years\n");
scanf("%lf",&n);

for(i=1;i<=n;i++)
{
amt=simpint(p,r);
p=p+amt;
}
printf("The compund interest after %lf years is %lf",n,p);
getch();
}
double simpint(double p,double r)
{
return((p*r)/100);
}

Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.

No comments:

Post a Comment