Recursion - Replace all pi

What’s wrong in my code??
I’m not getting any output.

Hi prashant
Your code goes into infinite recursion loop.
Terminate the recursion when idx has reached end of string.

Hope it helps
Give a like and rating if you’re satisfied.

how can I do this???

Hi prashant

  1. Correct the base case as mentioned above
  2. use recursive call after checking for pi

Corrected Code: https://ide.codingblocks.com/s/152099

Hope this helps
Mark resolved if satisfied.

1 Like

Thank You…

No problem :slight_smile:
Please Mark the doubt as resolved.