Advertisement
476179

7B-EX3ForLoop

Nov 16th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>The For Loop</title>
  6. </head>
  7.  
  8. <body>
  9. <script>
  10. // a program that asks user for humber range and this prints the range with a loop
  11.  
  12. var num1 = parseInt(prompt("enter the first number :"));
  13. var num2 = parseInt(prompt("enter the second number :"));
  14.  
  15. for ( var i = num1; num1 <= num2; num1++)
  16. {
  17. document.write( num1 + "<br>");
  18. }
  19.  
  20. </script>
  21. </body>
  22.  
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement