Wednesday, December 10, 2014

add and subtract programme for std 12 shakti

<html>
<head>
<title> Simple Adder </title>

<script type="text/JavaScript">
<!--
function addNumbers(n1,n2)
{
var no1 = parseFloat(n1);
var no2 = parseFloat(n2);
Adderfrm.total.value = no1+no2;
}
function clearNumbers()
{
Adderfrm.number1.value = "";
Adderfrm.number2.value = "";
Adderfrm.total.value = "";
}
-->
</script>
</head>

<body>
<form name="Adderfrm" method="post">

<h1>Simple Adder</h1>

<h2>Enter a number:
<input type="text" name="number1" size=20> <br><br>

Enter a number:
<input type="text" name="number2" size=20> <br><br>

<input type="button" name="AddButton" value="Add Numbers"
onClick="addNumbers(number1.value,number2.value)">

<input type="button" name="ClearButton" value="Clear Fields"
onClick="clearNumbers()"> <br><br>

Answer =
<input type="text" name="total" size=12>
</h2>
</form>
</body>
</html>

No comments:

Post a Comment