#include<stdio.h>
#include<math.h>
int main()
{
float p,q,r,smpi,cmpi;
int n;
clrscr();
printf("Enter the value of principle p = ");
scanf("%f",&p);
printf("Enter the value of rate r = ");
scanf("%f",&r);
printf("Enter the value of period in year n = ");
scanf("%d",&n);
smpi=((p*r*n)/100);
printf("The Simple Interest is=%f \n",smpi);
q=1+(r/100);
cmpi=p*pow(q,n)-p;
printf("The Compound Interest is=%f \n",cmpi);
return 0;
getch();
}
#include<math.h>
int main()
{
float p,q,r,smpi,cmpi;
int n;
clrscr();
printf("Enter the value of principle p = ");
scanf("%f",&p);
printf("Enter the value of rate r = ");
scanf("%f",&r);
printf("Enter the value of period in year n = ");
scanf("%d",&n);
smpi=((p*r*n)/100);
printf("The Simple Interest is=%f \n",smpi);
q=1+(r/100);
cmpi=p*pow(q,n)-p;
printf("The Compound Interest is=%f \n",cmpi);
return 0;
getch();
}
OUTPUT:-
No comments:
Post a Comment