Thursday, 5 February 2015

Create an HTML pageto add two number using javascript

Create an HTML pageto add two number using javascript

<html><head>
<title>
Prashant Aanand
</title>
<script type="text/javascript" >
var a;
var b;
var c;
a=window.prompt("Enter first no.");
b=window.prompt("Enter second no.");
a=parseInt(a);
b=parseInt(b);
c=(a+b);
window.alert("Sum of "+a+" and "+b+" is "+c);
window.confirm("Is your answer correct");
document.write("");
</script>
</head>
<body>
<em>Program to add two number.</em>
</body>
</html>

No comments:

Post a Comment