Simple Interest Compound interest by using C

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int p,t;
float r,si,ci;
clrscr();
printf(“enter the value\n principle\n time\n rate\n”);
scanf(“%d%d%f”,&p,&t,&r);
/*formula of the simple interest and compound interest*/

si=p*r*t/100.0;
ci=p*pow(1+r/100.0,t)-p;
printf(“Simple interest=%0.1f\n”,si);
printf(“compound interest=%0.1f”,ci);
getch();
}

After running program-

Leave a Reply