in Programming in C
551 views
2 votes
2 votes

in Programming in C
551 views

2 Comments

Since you have given option D so you don't need the whole explanation of how this recursion works.

Why you didn't get that extra 0 is because you mistakenly thought that it is like:

if(x>0)
{
    myfunc(--x);
    print("%d",x);
}

  But check the braces.. print statement is not inside the if block. So myfunc(0) will print that one extra 0.

1
1
answer should be option A only.
1
1

1 Answer

0 votes
0 votes
Caption