<!DOCTYPE html>

<html>

<head>

      <title>M2-R5.1 Set 2 Question 2</title>

</head>

<body>

      <center>

      <h1>JavaScript Output As Calculator</h1>

  1. A+B=<input type=”text” id=”add” disabled> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  2. A-B=<input type=”text” id=”sub” disabled><br><br><br><br>
  3. AxB=<input type=”text” id=”mul” disabled>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  4. A/B=<input type=”text” id=”div” disabled>

      </center>

<script type=”text/javascript”>

      var num1=parseInt(prompt(“Enter First Number “));

      var num2=parseInt(prompt(“Enter Second Number “));

      var a=num1+num2;

      document.getElementById(‘add’).value=a;

      var b=num1-num2;

      document.getElementById(‘sub’).value=b;

      var c=num1*num2;

      document.getElementById(‘mul’).value=c;

      var d=num1/num2;

      document.getElementById(‘div’).value=d;

</script>

</body>

</html>