First of all : why did you call the function factorial ? Did you base the code on some recursive function that calculates the factorial ? You didn't change much ... Are you trying to implement a factorial function ?
I would suggest you first write down the algorithm you want to use in pseudo code. How would you approach calculating 2^n recursively ?
Main Topics
Browse All Topics





by: Fang1964Posted on 2008-05-11 at 19:03:28ID: 21544269
Help will be much appreciated.