Professional Documents
Culture Documents
Trabajo Con For, While y Do While
Trabajo Con For, While y Do While
ALFEREZ VILCA
SEMESTRE: VI
UNIDAD DIDACTICA: TALLER DE PROGRAMCION WEB
ESTUDIANTE: MICHAEL G. VILCA GARCIA
AYAVIRI-MELGAR-PUNO
2021
TRABAJO ENCARGADO EN PHP
TABLA DE MULTIPLICACIÓN CON DOWHILE:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<tr>
</tr>
<tr>
</tr>
<tr>
<?php
$t=1;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
?>
</tr>
<tr>
<?php
$t=2;
$i=1;
do{
$tabla=$t*$i;
$i++;
}
while ($i<=12);
?>
</tr>
<tr>
<?php
$t=3;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
?>
</tr>
<tr>
<?php
$t=4;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
{
}
?>
</tr>
<tr>
<?php
$t=5;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
?>
</tr>
<tr>
<?php
$t=6;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
?>
</tr>
<tr>
<?php
$t=7;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
?>
</tr>
<tr>
<?php
$t=8;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
?>
</tr>
<tr>
<?php
$t=9;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
?>
</tr>
<tr>
<?php
$t=10;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
?>
</tr>
<tr>
<?php
$t=11;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
?>
</tr>
<tr>
<?php
$t=12;
$i=1;
do{
$tabla=$t*$i;
$i++;
while ($i<=12);
?>
</tr>
</table>
</body>
</html>
TABLA DE MULTIPLICACIÓN CON FOR:
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<tr>
</tr>
<tr>
</tr>
<tr>
<?php
$t=1;
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=2;
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=3;
{
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=4;
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=5;
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=6;
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=7;
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=8;
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=9;
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=10;
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=11;
$tabla=$t*$i;
?>
</tr>
<tr>
<?php
$t=12;
$tabla=$t*$i;
?>
</tr>
</table>
</body>
</html>
TABLA DE MULTIPLICACIÓN CON WHILE:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<tr>
</tr>
<tr>
</tr>
<tr>
<?php
$t=1;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
<tr>
<?php
$t=2;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
<tr>
<?php
$t=3;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
<tr>
<?php
$t=4;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
<tr>
<?php
$t=5;
$i=1;
while ($i<=12)
$tabla=$t*$i;
echo "<th> <center> $t*$i = $tabla </center> </th>";
$i++;
?>
</tr>
<tr>
<?php
$t=6;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
<tr>
<?php
$t=7;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
<tr>
<?php
$t=8;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
<tr>
<?php
$t=9;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
<tr>
<?php
$t=10;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
<tr>
<?php
$t=11;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
<tr>
<?php
$t=12;
$i=1;
while ($i<=12)
$tabla=$t*$i;
$i++;
?>
</tr>
</table>
</body>
</html>