need help understanding recursive function
Archived 2 years ago
K
korg03
i want to understand the backtracking as the recursion unwinds in the following code. Can somebody please explain the output.
```#include<stdio.h>
void solve(int x);
int main()
{
solve(3);
return 0;
}
void solve(int x)
{
if(x==0)
{
printf(" %d", x);
return;
}
printf(" %d", x);
solve(x-1);
printf(" %d", x);
}```
