Hello,
I wrote the function:
int topower(int base, int pwr) {
int topow = 1;
long int amt = base;
while ( topow < pwr ) {
amt = amt * base;
topow++;
}
if ( pwr == 0 ) { amt = 1; }
printf("\n%d:(%d)--%d--", base, pwr, amt);
return amt;
}
since pow() didn't seem to like me for some reason =)
problem is, when i try doing 10^10 (10000000000) I get "1410065408" in printf(). I assume that I'm using an incorret variable type?
Thanks,
Drek