Re: that was pretty painless
Quote:
Originally posted by drdodirty2002
I understand everything except this portion of the code
double pow(double x, double y)
{
double power= x*y;
return(power);
}
why x * y;
doesn't that say multiply x times y.
Yea.. I was writing it while helping someone reset there password. Sorry.
Sumpton I didnt even look at his printf() statements. I just fixed the for loop (you know cut and paste ;)
Re: Re: that was pretty painless
Quote:
Sumpton I didnt even look at his printf() statements. I just fixed the for loop (you know cut and paste ;)
I figured, and my name is stumon, lol. No biggy. Dr Dirty, something like this would pow the number.
Code:
double pow(double x, double y)
{
int i;
double x2 = x;
for (i = 0; i < y; i++){
x = x * x2;
}
return(x);
}
Or, you could include the math.h header and it has a pow() function in it. If you needed to use it.