Javascript program to enter two numbers and find their sum
ADVERTISEMENTS
A program to the sum of two integer values
<script type="text/javascript">
var p, q, r;
p = 5;
q = 9;
// calculating sum
r = p + q;
document.write("Result:: " + p + " + " + q + " = " + r);
</script>
Output Screen:
Result:: 5 + 9 = 14
A program to the sum of two integer values with minimum variable
<script type="text/javascript">
var p, q;
p = 5;
q = 9;
// calculating sum
p = p + q;
document.write("Result:: " + p);
</script>
Output Screen:
Result:: 14