Square of Number

By Developgram - April 19, 2017

<html>
<head>
  <script>
    function square(num)
    {
      var result = parseInt(num * num);

      document.write("Square of " + num + " is " + result);
    }
  </script>
</head>
<body>
  <script>
    var n = parseInt(prompt("Enter an integer"));

    square(n);
  </script>
</body>
</html>


  • Share:

You Might Also Like

0 comments