logic errors
Posted: Sat Apr 18, 2009 1:00 am
Hi everyone-
I have the following code and supposedly it contains logic errors. I'm not sure what they are so if someone can help me out with that I will really appreciate it. Thanks!!
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>While Logic</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
$Count = 0;
while ($Count > 100) {
$Numbers[] = $Count;
++$Count;
foreach ($Count as $CurNum)
echo "<p>$CurNum</p>";
}
?>
</body>
</html>
I have the following code and supposedly it contains logic errors. I'm not sure what they are so if someone can help me out with that I will really appreciate it. Thanks!!
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>While Logic</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
$Count = 0;
while ($Count > 100) {
$Numbers[] = $Count;
++$Count;
foreach ($Count as $CurNum)
echo "<p>$CurNum</p>";
}
?>
</body>
</html>