Advertisement
RokiAdhytama

Product - Chapter 7

Jul 2nd, 2022
824
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.75 KB | None
  1. <html xmlns = "http://www.w3.org/1999/xhtml">
  2.    <head>
  3.       <title>Product of Three Integers</title>
  4.  
  5.       <script type = "text/javascript">
  6.          <!--
  7.          // Calculate the product of three integers
  8.          var x, y, z, result;
  9.          var xVal, yVal, zVal;
  10.  
  11.          xVal = window.prompt( "Enter first integer:", "0" );
  12.          yVal = window.prompt( "Enter second integer:", "0" );
  13.          zVal = window.prompt( "Enter third integer:", "0" );
  14.  
  15.          x = parseInt( xVal );
  16.          y = parseInt( yVal );
  17.          z = parseInt( zVal );
  18.  
  19.          result = x * y * z;
  20.          document.writeln( "<h1>The product is " +
  21.                             result + "<h1>" );
  22.          // -->
  23.       </script>
  24.  
  25.    </head><body></body>
  26. </html>
Advertisement
RAW Paste Data Copied
Advertisement