Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>The For Loop</title>
- </head>
- <body>
- <script>
- // a program that asks user for humber range and this prints the range with a loop
- var num1 = parseInt(prompt("enter the first number :"));
- var num2 = parseInt(prompt("enter the second number :"));
- for ( var i = num1; num1 <= num2; num1++)
- {
- document.write( num1 + "<br>");
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement