For example pow(3,3)
returns 27
I tried while
and I tried a for
loop. I'm missing something obvious. Just unsure what it is. Can someone walk me through this, please?
$i = 1;
while ($i <= $exponent) {
$result = ($base * $base);
$result = $result * $result;
$i++;
echo $result;
}