-
Notifications
You must be signed in to change notification settings - Fork 1
/
P2.html
47 lines (44 loc) · 1.88 KB
/
P2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!-- Program 2:- Develope a HTML form which accepts any mathematical expression.
Write JS code to evaluate the expression and display the result. -->
<html>
<head>
<title>Lab_Program_2</title>
<script type="text/javascript" src="P2.js"></script>
</head>
<body bgcolor="lightblue">
<center>
<h2>Arithmetic operations</h2>
<hr/><br/>
<form name="mathform">
<table border="1" cellpadding="5" cellspacing="5">
<tr>
<th>enter the first operand</th>
<th>select the operation</th>
<th>enter the second operand</th>
<th>result</th>
</tr>
<tr>
<td><input type="text" name="op1"></td>
<td>
<select name="operator">
<option name="sum" value="+">+</option>
<option name="diff" value="-">-</option>
<option name="prod" value="*">*</option>
<option name="div" value="/">/</option>
<option name="mod" value="%">%</option>
<option name="exp" value="exp">exp</option>
</select>
</td>
<td><input type="text" name="op2"/></td>
<td><input type="text" name="result"/></td>
</tr>
<tr>
<td colspan="4" align="center">
<input type="button" name="calresult" value="calculate" onclick="calculate()"/>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>