|
|
1. fun(5) is called, a == 5. a != 2. a == 4, call fun(4) 2. fun(4) is called, a == 4, a != 2, a == 3, call fun(3) 3. fun(3) is called, a == 3, a != 2, a == 2, call fun(2) 4. fun(2) is called, a == 2, print value of 'a' ((2)), recursive calling ends, print 'a' ((2)) 5. return to fun(3), print value of 'a' ((2)) 6. return to fun(4), print value of 'a' ((3)) 7. return to fun(5), print value of 'a' ((4)). 8. Program terminates. |