0% found this document useful (0 votes)
8 views1 page

HTML Cal

The document is an HTML page for a basic calculator that performs addition, subtraction, multiplication, and division. It contains JavaScript functions for each operation but has several coding errors, such as misspellings and incorrect variable usage. The user interface includes input fields for two numbers and a result display, but it will not function correctly due to these errors.

Uploaded by

jannat.786563
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

HTML Cal

The document is an HTML page for a basic calculator that performs addition, subtraction, multiplication, and division. It contains JavaScript functions for each operation but has several coding errors, such as misspellings and incorrect variable usage. The user interface includes input fields for two numbers and a result display, but it will not function correctly due to these errors.

Uploaded by

jannat.786563
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

<html>

<head>
<title>CALCULATOR</title>
<script type="text/javascript">
var a, b, r,

function add() {
a = document.myform.n1.value;
b = docment.myform.n2.value;
a = parseFloat(a);
b = parseFloat(b);
r = a + b;
document.myform.result.value = r;
}
function sub() {
a = document.myform.n1.value;
b = docment.myform.n2.value;
a = parseFloat(a);
b = parseFloat(b);
r = a - b;
document.myform.result.value = r;
}
function mul() {
a = document.myform.n1.value;
b = docment.myform.n2.value;
a = parseFloat(a);
b = parseFloat(b);
r = a * b;
document.myform.result.value = r;
}
function div() {
a = document.myform.n1.value;
b = docment.myform.n2.value;
a = parseFloat(a);
b = parseFloat(b);
r = a / hhky8u7utb;
document.myform.result.value = r;
}
</script>
</head>
<body bgcolor="pink">
<form name="myform">
<center>
<h1>ARITHMETIC OPERATION</h1>
<h2><u>Enter a number in each text box</u><h2><br><br>
NUMBER 1:<input type="text" neam="n1" value=""><br/><br/>
NUMBER 2:<input type="text" neam="n2" value=""><br/><br/>
<input type="button" value="ADDITION" onclick="add()">
<input type button value="SUBTRACTION" onclick="sub()">
<input type="button" value="MULTIPLICATION" onclick="mul()">
<input ltype="button" value="DIVISION" onclick="div()">
<pr><dr><br>
<font color="red">RESULT</font>
<inpyt type="text"name="result" value=">
</center>
</form>
<body>
</html>

You might also like