I wrote this simple program using JavaScript as my programming language to ask the user to give two numbers and then the program will compute the sum of the two numbers and display the results on the screen.
My website is http://www.jakerpomperada.com
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.
Program Listing
index.php
<html>
<head>
<title>Addition of Two Numbers in JavaScript</title>
</head>
<body>
<hr>
<h2 align="center">Addition of Two Numbers in JavaScript</h2>
<hr>
<br>
<script type="text/javascript">
a = parseInt(prompt("Enter First Value"));
b = parseInt(prompt("Enter Second Value"));
sum = (a+b);
document.write("<h3> The First Value is " + a + ".</h3>")
document.write("<h3> The Second Value is " + b + ".</h3><br>")
document.write("<h3>The sum of "+ a + " and "
+ b + " is " + sum + ".</h3>");
</script>
No comments:
Post a Comment