<!DOCTYPE html>
<html>
<head>
<title>M2-R5.1 Set 2 Question 2</title>
</head>
<body>
<center>
<h1>JavaScript Output As Calculator</h1>
- A+B=<input type=”text” id=”add” disabled>
- A-B=<input type=”text” id=”sub” disabled><br><br><br><br>
- AxB=<input type=”text” id=”mul” disabled>
- 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>