Thursday, August 19, 2010

C Programming - calculate simpleI & compound interest

#include<stdio.h>
#include<conio.h>
main()
{
int p,t;
float r,si,ci;
clrscr();
printf("\n enter the amount,time and rate=");
scanf("\n %d%d%f",&p,&t,&r);
si=(p*r*t)/100;
printf("\n simple interest=%f",si);
ci=p+si;
printf("\n compound interest=%f",ci);
getch();
}

output:-enter the amount,time and rate=3000
4
5
simple interest =600
compound interest =3600

No comments:

Post a Comment