Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>ex1.loops</title>
- </head>
- <body>
- <script>
- var num1, num2, b;
- num1 = parseFloat(prompt("Which multiplication table would you like?"));
- num2 = parseFloat(prompt("How high do you want to go?"));
- b = 1;
- while(b <= num2)
- {
- document.write(num1 + " x "+ b + " = " + (b * num1)+ "<br>");
- b ++;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment