Problem with recurrsion

Hi, All

I'm trying to call a function recursively. I tried this code and it doesnt seem to work correctly. The code compiles perfectly but it gives the wrong output. Can you guys suggest what might be wrong in here..