Monday, 8 November 2010

find simple interest and compound interest

//find simple interest and compound interest
#include<stdio.h>
#include<conio.h>
void main()
{
 float p,t,r,si,ci;
 clrscr();
 printf("enter values of principal amt, no of years and interest");
 scanf("%f%f%f", &p,&t,& r);

 si=p*t*r/100;
 ci=p*pow(1+r/100,t)-p;

 printf("simple interest =%.2f \n",si);
 printf("compound interest=%.2f\n",ci);
 getch();
}

c programs

No comments:

Post a Comment