Thursday, 8 September 2016

WAP to find compound interest.


WAP to find compound interest.


//Compound interest = Amount-principal
//Amount=Principal*(1+rate/100)^time
//To calculate compound interest.

#include<stdio.h.
#include<conio.h>
#include<math.h>
Void main( )
{
Float p,r,t,a,ci;
Clrscr( );
Printf(“\n Enter principal amount,rate of interest and time”);
Scanf(“%f%f%f”,&p,&r,&t);
A=p*pow((1+r/100),t);
Ci=a-p;
Printf(“\n The compound interest is =%f”,ci);
Getch( );
}
Output.
Enter principal amount, rate of interest and time 5000 12 3
The compound interest = 2024.640137.

0 comments: