Adobe Interview Question
Country: United States
Interview Type: Phone Interview
correct all print statements will execute in reverse order after last recursive call will return
But in Main() fun() is called twice.
So there should be 2 inputs for the program to exit.
Although in the above scenario it will print the mentioned string and will be waiting for the new line.
i hope you know calling recursion function is like using stack. when you enter helloworld, it keeps on calling the fun() until enter is pressed. once it is entered, value from the previous calling fun() get printed in reverse order like popping the data from the stack.
- Hari September 19, 2012