Hello Vijitha,
Thanks for the reply. When I execute the piece of code in debug mode(presuming I have understood the question right and have the code right), what happens is that first it goes through the 1st printin method recursively, I can see the values of i decrement 16,8,4,2,1. So n == 1 is true, it executes return and hits the next printin method. But this time when printin executes n is 2. 2/2 is 1 so n ==1, so it hits return, but the stack is still there, so the 1st printin get called again and then it gets confusing. Does my code meet the requirements of the question?
Might sound very trivial, but I have been trying to figure it out for almost a day before I put my post..
Please help,
Thanks,
Bhanu.