c Programming

Write Program to find Simple Interest and Compound Interest

By April 4, 2016 November 9th, 2016 No Comments

/*Program to find Simple Interest and Compound Interest
SI = (p * r * t) / 100
CI = p * pow((1 + r/100), t) – p*/
#include <stdio.h>
#include <math.h>
main()
{
float p, r, t, si, ci;
printf(“\nEnter priciple, rate and time: “);
scanf(“%f %f %f”, &p, &r, &t);
si = (p * r * t) / 100;
ci = p * pow((1 + r/100), t) – p;
printf(“\n\nSimple Interest: %.2f”, si);
printf(“\n\nCompound Interest: %.2f”, ci);
getch();
}

Leave a Reply