home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
progm
/
elem-c.zip
/
PYMT.C
< prev
next >
Wrap
Text File
|
1985-05-18
|
768b
|
35 lines
/*
** determine payment if balance and rate and term is known
*amount = starting balance
*balance = remaining balance
*rate = interest rate per period
*rate1 = interest rate per year
*payment = monthly payment
*principal = payment to principle
*interest = payment of interest per period
*number = number of payments
* payment=Balance/((1-(1+rate)^-Number)/rate)
*/
float amount; /* declare external veriables */
float rate;
float payment;
float rate1;
#include "math.h" /* include declaration for pow() */
pymt()
{
float number;
printf("How many payments ? ");
scanf("%f",&number);
payment = amount / ((1 - pow((1. + rate),-number))/rate);
}