K
Ken
Hello,
I have this recusrion code below I know how the looping works, but where I
get confused is with the return 1, How does it know to send the accumulated
value and not just returning the number 1 with any n input.
int recursion(int n)
{
if (n == 0) return 1;
else return n * recursion(n-1);
};
-Ken
I have this recusrion code below I know how the looping works, but where I
get confused is with the return 1, How does it know to send the accumulated
value and not just returning the number 1 with any n input.
int recursion(int n)
{
if (n == 0) return 1;
else return n * recursion(n-1);
};
-Ken