Quote:Original post by PsyberMindCongratulations [smile]
WooHoo! I did it on the first try (I think)
A few constructive comments on your process function...
The name 'process' is unhelpfully generic, always give things descriptive names, in this case something like 'factorial' would be sufficient.
Your function implementation is reasonably long-winded for what it does. First you have separated the declaration of temp from its initialisation - this wasn't necessary as you could have both initialised and declared temp in a single statement, which is the preferred practice when it's possible to do so:
int temp = number * factorial(number - 1);
Secondly, you don't actually need an explicit variable at all! You can simply return the value directly rather than assigning it to temp first:
int factorial(int number){ if (number <= 1) return 1; return number * factorial(number - 1);}