# Concept of Recursion in the STACK

• A simple base case (or cases) — a terminating scenario that does not use recursion to produce an answer
• A recursive step — a set of rules that reduces all successive cases toward the base case.

for example:

This is a typical recursive functions a recursive function to compute x power y, where x and y are integers:

`float _pow_recursion(float x, float y){    if (y == 0)        return (1);    if (y < 0)        return (_pow_recursion(x, y + 1) / x);    return (_pow_recursion(x, y - 1) * x);}`
• base case:

when y = 0, this will allow the function to stop recursive calls to itself

`if (y == 0)        return (1);`
• recursive statement : increment of decrement y and call back the function _pow_recursion with y + 1 or y -1 : if y is a positive integer, y -1 will decrease to 0 (if y is a negative integer, it will increase to 0)
`if (y < 0)        return (_pow_recursion(x, y + 1) / x);    return (_pow_recursion(x, y - 1) * x);`

what is happening when we execute : _pow_recursion (4, 3).