Code:
<html>
<!-- test01.php -->
<body>
<?php
$x = 2;
for ($i = 1; $i <= 6; $i++)
{
if ($i % 2 == 1)
{
$x++;
}
print $i . 'x' . $i * $x . " ";
}
?>
</body>
</html>
X = 2 rite,
Then howcome the answer to the code is:
1 x 3, 2 x6, 3 x 12, 4 x16, 5 x 25, 6 x30
x++(shouldn't it be 3, 5, 7, 9, 11, 13)
I am confused...
*******
Answer:
1x3 2x6 3x12 4x16 5x25 6x30
Comment