Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- </head>
- <body>
- <script type="text/javascript">
- var x =prompt("x");
- var n = prompt("n");
- var i, y;
- x=parseInt(x);
- n=parseInt(n);
- if((!isNaN(x))&&(!isNaN(n)))
- {
- {
- for(i = 1,y=x;i < n ; i++)
- {
- x*=y;
- }
- document.write(y+ " ^ " + n + " = " + x);
- }
- }
- else{document.write("You haven't entered an integer !")}
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement