<html>
<head>
<title>javascript using sum, product, difference and quotient</title>
<script>
var number1;
var number2;
var sum;
var product;
var difference;
var quotient;
number1 = parseInt(window.prompt( "Enter first number" ));
number2 = parseInt(window.prompt( "Enter second number" ));
sum = number1 + number2;
product = number1 * number2;
difference = number1 - number2;
quotient = number1 / number2;
document.writeln( "<h3>The sum is " + sum + "</h3>" );
document.writeln( "<h3>The product is " + product + "<h3>");
document.writeln( "<h3>The difference is " + difference + "<h3>");
document.writeln( "<h3>The quotient is " + quotient + "<h3>");
</script></head>
</html>
Output:
No comments:
Post a Comment