edited by
20,119 views
47 votes
47 votes

Consider the following two functions.

void fun1(int n) {
    if(n == 0) return;
    printf("%d", n);
    fun2(n - 2);
    printf("%d", n);
}
void fun2(int n) {
    if(n == 0) return;
    printf("%d", n);
    fun1(++n);
    printf("%d", n);
}

The output printed when $\text{fun1}(5)$ is called is

  1. $53423122233445$  
  2. $53423120112233$                       
  3. $53423122132435$  
  4. $53423120213243$                       
edited by

11 Answers

7 votes
7 votes

Ans is A 

4 votes
4 votes

https://en.wikipedia.org/wiki/Sequence_point

regarding confusion between pre and post.

Answer:

Related questions

68 votes
68 votes
5 answers
4