Is there an easier way to understand what this is doing step by step? I get very confused here, and I wonder if any of you fine people have a trick for breaking this down. I really want to get this, and understand the pattern, but what happens in the "else" return confuses me.
Thanks,
Cougarclaws
#include <iostream>
using namespace std;
float wk7recur (float value, int num)
{
if (num == 0)
return 1;
else
return ( value * wk7recur (value, num - 1) );
}
int main()
{
float answer = wk7recur (1.0, 5);
cout << answer;
cout << endl << endl;
system ("PAUSE");
return 0;
}