Exemplo n.º 1
0
function save4($pv, $int, $n)
{
    if ($n <= 0) {
        return $pv;
    }
    return save4($pv, $int, $n - 1) * (1 + $int);
}
function save4($pv, $int, $n)
{
    //use recursion by calling save 4 to calculate
    if ($n <= 0) {
        return $pv;
    } else {
        return save4($pv, $int, $n - 1) * (1 + $int);
    }
}