C program to calculate simple interest and compound interest

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float p,r,t,si,ci;
puts("Enter the principal value");
scanf("%f",&p);
puts("Enter the rate");
scanf("%f",&r);
puts("Enter the time");
scanf("%f",&t);
si=(p*r*t)/100;
ci=(p*pow(1+(r/100),t))-p;
printf("Simple interest = %.2f\n",si);
printf("Compound interest = %.2f\n",ci);
}

Comments