May 6, 2013

Using DoWhile Loop

Coding

<html>
<body>
<script language="JavaScript">
i = 0
do
{
document.write("The number is " + i)
document.write("<br>")
i++
}
while (i <= 5)
</script>
</body>
</html>

Explanation:

i equal to 0.

The loop will run

i will increase by 1 each time the loop runs.

While i is less than , or equal to, 5, the loop will continue to run.

No comments:

Post a Comment

Popular Posts

Views