i wrote a code for this
can you help me visualize it ?
after it reaches base case it returns value of one .
after that i am not able to understand what is happening and when is line number 12 executed ? (return ans)
is it executed every time we go from top to bottom or in the last step ?
Recursive function for power
hello @chitranshanmol07
from base case u return 1 .
this returned value will get mutiplied by a. and then return a.
this returned value will get multiple by a and then return a^2
…
,…
…this returned value will get multipleid by a then return a^n.
this will be flow of ur recursion.