D
David
I posted this program earlier today and some of you helped me greatly
with this program. However, I am receiving an error that I do not
understand. Thanks for your help; I appreciate it.
Here is the program:
#include <stdio.h>
#include <math.h>
#define principle 100000
int main(void)
{
int time, years, interest;
double monthlypayment, amount, r, q, n;
printf(" Mortgage Payment Plan\n");
printf("Principle Interest Rate Duration Monthly Payment Total
Payment\n");
for(interest=6; interest<11; interest+1)
{
for(time=5; time<35; time+5)
{
n = interest/100; //n is really the interest variable
years = time*12;
r = (1/ (1+n/12)); //r is just seperating code
q = pow(r, years); //q is just seperating code
monthlypayment = (principle*n/12) / (1-q);
amount = monthlypayment*time*12;
printf("%d %.2f %d %.2f %.2f", principle, n, time,
monthlypayment, amount);
}
}
return 0;
}
David
with this program. However, I am receiving an error that I do not
understand. Thanks for your help; I appreciate it.
Here is the program:
#include <stdio.h>
#include <math.h>
#define principle 100000
int main(void)
{
int time, years, interest;
double monthlypayment, amount, r, q, n;
printf(" Mortgage Payment Plan\n");
printf("Principle Interest Rate Duration Monthly Payment Total
Payment\n");
for(interest=6; interest<11; interest+1)
{
for(time=5; time<35; time+5)
{
n = interest/100; //n is really the interest variable
years = time*12;
r = (1/ (1+n/12)); //r is just seperating code
q = pow(r, years); //q is just seperating code
monthlypayment = (principle*n/12) / (1-q);
amount = monthlypayment*time*12;
printf("%d %.2f %d %.2f %.2f", principle, n, time,
monthlypayment, amount);
}
}
return 0;
}
David