Home >>PHP Programs >Sum of two numbers without using + operator in PHP
<?php if(isset($_REQUEST['add'])) { $f=$_REQUEST['f']; $s=$_REQUEST['s']; for($i=1;$i<=$f;$i++) { $s++; } echo "<font color='blue'>Sum of two number=".$s."</font>"; } ?>
<html> <head> <title>Sum of two number without using "+" operator Table</title> <style> input{width:180px; height:35px} </style> </head> <body> <form method="post"> <table border="1" width="350px"> <tr> <td>Enter first number </td> <td><input type="text" name="f"/></td> </tr> <tr> <td>Enter second number </td> <td><input type="text" name="s"/></td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" value="+" name="add"/> </td> </tr> </table> </form> </body> </html>