PHP Program - Multiplication of two Numbers

We have created below PHP Program to multiply two Numbers. HTML <form> tag with post method is used to submit two numbers.

$_POST variable is used to retrive 2 numbers for performing multiplication.

Here, we have used 2 text field, 1 submit button and 1 form tag.

Example :

$result="Multiplication of " .$num1. " and ".$num2. " : " .$result;

<!DOCTYPE html>
<title>PHP Maths Program - Multiplication of two number by aryatechno</title>
<form name="sub" method="post">
<td colspan="2"><strong>Maths Multiplication program</strong></td>
<td>Number 1 :</td>
<td><input type="text" name="num1" value="<?=$_POST['num1'] ?>" required></td>
<td>Number 2 :</td>
<td><input type="text" name="num2" value="<?=$_POST['num2'] ?>" required></td>
<td><input type="submit" value="Multiplication" name="submit" /></td>

<td colspan="2"><strong><?=$result ?></strong></td>


Output :


Leave a Reply

Your email address will not be published. Required fields are marked *