Make while loop start counting from 5. Count up to (including) 50 and count only every fifth number. - Javascript Statement

Javascript examples for Statement:Quiz

Description

Make while loop start counting from 5. Count up to (including) 50 and count only every fifth number.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var i = 5;
while (i <= 50) {
    document.getElementById("demo").innerHTML += i + "<br>";
    i = i + 5;
}
</script>/* w  w w. j  a v  a2s.co m*/

</body>
</html>

Related Tutorials