2^3 = 8

Codi en PHP

<!DOCTYPE html>
<html lang="ca">
    <head>
        <title>Exercici 6 Guillem Serrat</title>
        <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <?php
        $base = 2;
        $exponent = 3;
        $cont = 0;
        $resultat = 1;

        while ($cont < $exponent) {
            $resultat = $resultat * $base;
            $cont++;
        }

        echo "$base^$exponent = $resultat";

        ?>
        <h1>Codi en PHP</h1>
        <?php
        show_source("ex6.php");
        ?>
    </body>
</html>