VB icon

Addition of Three Numbers Using Two Dimensional Array Using JavaScript

Email
Submitted on: 10/29/2015 1:52:44 PM
By: Jake R. Pomperada  
Level: Beginner
User Rating: Unrated
Compatibility: JavaScript
Views: 1859
author picture
 
     JavaScript is one of the hottest programming language now a days because of the intensive use of the Internet it is very seldom to see a website that does not use JavaScript in one way to another to make a website more interactive. In this article I would like to share with you another program that I wrote to understand the concept of two dimensional array in JavaScript. Technically speaking JavaScript does not have a two or multidimensional array as data structure it only relies on one dimensional array but surprisingly creating two dimensional array in JavaScript is very easy. The sample program that I will share is an addition of three numbers using two dimensional array in JavaScript. I hope you will find my work useful and learn from it.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Addition of Three Numbers Using Two Dimensional Array Using JavaScript
' Description:JavaScript is one of the hottest programming language now a days because of the intensive use of the Internet it is very seldom to see a website that does not use JavaScript in one way to another to make a website more interactive. In this article I would like to share with you another program that I wrote to understand the concept of two dimensional array in JavaScript.
Technically speaking JavaScript does not have a two or multidimensional array as data structure it only relies on one dimensional array but surprisingly creating two dimensional array in JavaScript is very easy. The sample program that I will share is an addition of three numbers using two dimensional array in JavaScript. I hope you will find my work useful and learn from it.
' By: Jake R. Pomperada
'**************************************

<html>
<body>
<style>
h3 {
font-family:arial;
};
 </style>
<script>
var arr = [];
val1 = Number(prompt("Enter First Value :"));
val2 = Number(prompt("Enter Second Value : "));
val3 = Number(prompt("Enter Third Value : "));
var arr1 = [val1,val2,val3];
arr.push(arr1);
a = arr[0][0];
b = arr[0][1];
c = arr[0][2];
var solve_add = (a+b+c);
document.write("<h3> Addition of Three Numbers Using Two Dimensional Array </h3>");
document.write("<font face='arial' size=4>Value store ");
document.write("in variable A is " + a + ".</font><br>");
document.write("<font face='arial' size=4>Value store ");
document.write("in variable B is " + b + ".</font><br>");
document.write("<font face='arial' size=4>Value store ");
document.write("in variable C is " + c + ".</font><br>");
document.write("<br>");
document.write("<font face='arial' size=4>The sum of " + a );
document.write(" , " + b + " and " + c + " is " + solve_add + ".");
</script>
</body>
</html>


Other 108 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.