Code In Tech - The Ultimate World of Computer Technology

Saturday, 24 March 2012

C Program to Find the simple and compound interest

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
 float si,ci,p,r,n,a;
 clrscr();
 printf("Enter the value of principle amount:");
 scanf("%f",&p);
 printf("Enter  the  value  of interest rest:");

 scanf("%f",&r);
 printf("Enter    the    number    of   year:");
 scanf("%f",&n);
 si=p*r*n/100;
 printf("\nvalue   of   simple   interest  is: %f",si);
 a=p*pow((1+r/100),n);
 ci=a-p;
 printf("\nvalue   of  compound  interest  is: %f",ci);
 getch();
}

No comments :

Post a Comment