D
David
Here is some code. I am trying to figure out how to raise, say, x to
the yth power. I know that isn't explicitly what is in the code but
that is the idea I am trying to solve. See the 2nd for loop>>3 errors.
#include <stdio.h>
#include <math.h>
int main(void)
{
#define p 100000;
int j, k, t, s;
float i;
double m, a, r, q;
printf(" Mortgage Payment Plan");
printf("Principle Interest Rate Duration Monthly Payment
Total Payment");
for(i=0.06; i<0.11; i+0.01)
{
for(t=5; t<35; t+5)
{
s = t*12;
r = (1/ (1+i/12));
q = pow(double r, int s);
m = (p*i/12) / (1-q);
a = m*t*12;
printf("%d %.2f %d %.2f %.2f", p, i, t, m, a);
}
}
return 0;
}
The style isn't very good. But, I just need to produce an output for
class. Hey, thanks for your help with this one. I appreciate it.
David
the yth power. I know that isn't explicitly what is in the code but
that is the idea I am trying to solve. See the 2nd for loop>>3 errors.
#include <stdio.h>
#include <math.h>
int main(void)
{
#define p 100000;
int j, k, t, s;
float i;
double m, a, r, q;
printf(" Mortgage Payment Plan");
printf("Principle Interest Rate Duration Monthly Payment
Total Payment");
for(i=0.06; i<0.11; i+0.01)
{
for(t=5; t<35; t+5)
{
s = t*12;
r = (1/ (1+i/12));
q = pow(double r, int s);
m = (p*i/12) / (1-q);
a = m*t*12;
printf("%d %.2f %d %.2f %.2f", p, i, t, m, a);
}
}
return 0;
}
The style isn't very good. But, I just need to produce an output for
class. Hey, thanks for your help with this one. I appreciate it.
David