I am having a hard time understanding the code below. Once the IF statement counts down to 0 it stops, but then "cout<<endl<<n;" starts running and counting until 2.
void guess(int n){
if(n > 0){
cout << n;
n--;
guess(n);
cout << endl << n;
}
}
int main(){
guess(3);
}
// The result is "321
0
1
2"
WHY it counts backwards from 0 to 2 after the end of the IF statement??? I tried debugging it to closely see the process of recursion but it did not help either.