I did the code (trial and error) i did not copied it. I saw the problem on the internet to display 1-10 then 10-1 so i did.
I can follow from 1-10 but after that im confused because i tried changing the value of return 0 and the output changes. I just want to know how does the return 0 affects the output.
Can you please show me the program flow?
I tried to use F11 + addwatch but still i can trace the part where the recursion happens.
Did the function stored the return values while it was recursing or is it using the return 0?
Thank you. and again i did not copy it. I did it by trial and error.
So what about this thread where someone has already helped you step through a different recursive program?
The experts here are not necessarily teachers...I suggest that you get a recursion tutorial (recursion is just logic, so it can be in any language) and read it. Once you understand the theory behind recursion, these problems aren't as confusing.