FY B.sc IT Practical 4(B) : Design a web page demonstrating different looping statements.

 

Code:

<!DOCTYPE html>

<html>

<head>

<title>Looping Statements</title>

<script language="javascript">

document.write("For Loop demo:<br>");

for (i = 0; i < 5; i++)

{

 text1 += "The number is " + i + "<br>";

document.write(text1+" ");

}

document.write("<br>While Loop demo:<br>");

while (i < 10)

{

text2 += "The number is " + i;

document.write(text2+" ");

i++;

}

document.write("<br>Do-While Loop demo:<br>");

do

{

text3 += "The number is " + i;

document.write(text3+" ");

 i++;

}while (i < 10);

</script>

</head>

<body>

</body>

</html>

Comments

Popular posts from this blog

Create an android app that demonstrates Activity Lifecycle and Instance State.

Program using Light Sensitive Sensors on Tinkercad

Blink LED pattern using Arduino on Tinkercad