Advertisement
LightProgrammer000

Potenciação

Jan 27th, 2019
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2.  
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4.  
  5.     <head>
  6.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7.         <title> Testando JavaScript </title>
  8.  
  9.         <style> </style>
  10.  
  11.         <script type="text/javascript">
  12.        
  13.             function quadrado(num)
  14.             {
  15.                 return(Math.pow(num, 2));
  16.             }
  17.            
  18.             var num = prompt("Digite um Número: ", 0);
  19.            
  20.             alert("--- Resultado --- \n\n ["+ num +"]² = " + quadrado(num));
  21.  
  22.         </script>
  23.     </head>
  24.  
  25. <body>
  26.  
  27. </body>
  28.  
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement