#1 Calcula a tabuada Sáb Out 26, 2013 7:12 pm
Admin
Admin
Sistema Fácil de calcular a tabuada de qualquer numero em PHP.
- Código:
<html>
<head>
<title>Teste</title>
</head>
<body>
<form name="teste" method="post" action="index.php">
Digite um valor
<input type="text" name="danilo" />
<input type="submit" value="Calcular" />
</form>
<table border="2">
<tr>
<td>Tabuada</td>
</tr>
<?php
if(isset($_POST["danilo"]))
$danilo = $_POST["danilo"];
for($i=0;$i<=10;$i++)
{
$resultado = $danilo*$i;
echo "<tr>";
echo "<td>" .$danilo. " * " .$i. " = " .$resultado. "</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>