Hi everyone,
I'm just stuck on a powfun function problem. It just states to enter an integer, enter a positive integer power, and find the result, i.e 2^3=8. I just don't know how to go about using a for loop in the powfun function. Here's what I have [I know it's not correct but I'm trying to find the correct "conditions" inside for ()]:
void powfun (int a, int b)
{
long int result;
for (result = a; ; result++)
result = result * a;
cout << result;