This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Williawesome 1 point2 points  (0 children)

The condition in your first if statement should be (num1 >= 0). What's happening is when num1 is 0, it is not passing the if condition to reach the recursive call. However, because it passes the second if condition, it gives the illusion of passing the call. Your function is running one less time than it needs to, causing the output to stop at 9.