Advertisement
StefiIOE

x na stepen n

Feb 7th, 2020
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. </head>
  5. <body>
  6. <script type="text/javascript">
  7. var x =prompt("x");
  8. var n = prompt("n");
  9. var i, y;
  10. x=parseInt(x);
  11. n=parseInt(n);
  12. if((!isNaN(x))&&(!isNaN(n)))
  13. {
  14.  
  15.   {
  16.     for(i = 1,y=x;i < n ; i++)
  17.     {
  18.       x*=y;
  19.     }
  20.     document.write(y+ " ^ " + n + " = " + x);
  21.   }
  22. }
  23. else{document.write("You haven't entered an integer !")}
  24.  
  25. </script>
  26. </body>
  27. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement