R9--Found At Last

Code not giving output

Hello @GreatCoderboy123,

  1. The code is not printing value because you have not written any print statement.
    Where in your code are you printing the value returned by the function?

  2. The recursive call you have used is also wrong.
    There is no need to decrement n.

  3. The return statements inside the function are also incorrect.

I have modified your code:

Hope, this would help.
Give a like if you are satisfied.

ok…thanks…I understand it now