AnkitWebLogic

PHP - Find Power

Q. Write a program in PHP to calculate x power y. Eg. xy. Value of x and y is entered from user.
1

<html>
<body>
    <form action="" method="get">
        <p>Enter Number: <input type="text" name='a' value="<?php echo $a; ?>"></p>
        <p>Enter Power: <input type="text" name='b' value="<?php echo $b; ?>"></p>
        <button type="submit" name="submit">Submit</button>
    </form>
<?php
    if(isset($_GET['submit']))
    {
        $a=$_GET['a'];
        $b=$_GET['b'];
        $c = $a**$b;
        echo "$a Power $b = ". $c; 
    }
?>
</body>
</html>

Enter Number:

Enter Power: