please explain how work follow program
#include <stdio.h>
#include <stdlib.h>
void test(int *root){
printf("%d n", *root);
*root+=1;
if (*root>10)
return;
test(root);
//printf("AMA n");
test(root);
}
int main(){
int var=0;
test(&var);
}
the result of this program is:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
why? i don’t understand Recursion in C,
if results save in storage and then showed?
I try some versions of Recursion but don’t full understand it.
3