edited by
896 views
2 votes
2 votes

Avoid the any syntax error ,if there is:What will be the output of the following code ?
 

#inlcude<stdio.h>
void myfun(int i)
{   
    if(i>0) {
        myfun(i-1);
        printf("%d",i);
        myfun(i-1);
    }
}
int main() {
    myfun(3);
}

edited by

1 Answer

4 votes
4 votes

execute the tree from DFS manner you will get the output 1213121