Can't get recursive solution

in my code -“https://ide.codingblocks.com/s/92753
it is correct but i haven’t used recursion, i am having trouble in using recursion can not frequently use it…

for recursion you can refer this https://ide.codingblocks.com/s/92886
Break the recursion problem in 3 parts

  1. base case(when to stop)
    2)work towards base case
  2. recursive call
    practice more and more problems.start with the very basic ones