Two problems:
1) need a return value to return the factorial. Your function does the recursion but doesn't calculate anything.
2) The function's return value should be int, not void.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
You're not modifying the variable, just taking it as a parameter.
Do you have to use recursion and not a loop?
MosaicFuneral
Posting Virtuoso
1,691 posts since Nov 2008
Reputation Points: 888
Solved Threads: 116
daviddoria
Posting Virtuoso
1,996 posts since Feb 2008
Reputation Points: 437
Solved Threads: 204