multidimensional arrays

multidimensional arrays

Write a javascript code for inputting numbers and displaying that using multidimensional arrrays.

View Answers

October 29, 2010 at 4:57 PM

Hello Friend,

Try this:

<script>
           function multidimensionalArray(array) {
                    for(var x=0; x<3; x++) {
                    for(var y=0; y<3; y++){
                    document.write(array[x][y]+" ");
                    }
                    document.write("<br>");
                }
            }
            var array1 = new Array();
            for(var i=0;i<3;i++){
            var input=window.prompt("Enter Elements for array1: ");
            array1[i]=input;
            }

            var  array2 = new Array();
            for(var i=0;i<3;i++){
            var input=window.prompt("Enter Elements for array2: ");
            array2[i]=input;
            }

            var  array3 = new Array();
            for(var i=0;i<3;i++){
            var input=window.prompt("Enter Elements for array3: ");
            array3[i]=input;
            }

            var array = new Array(array1,array2,array3);
            multidimensionalArray(array);
</script>

Thanks









Related Tutorials/Questions & Answers:
multidimensional arrays
multidimensional arrays  Write a javascript code for inputting numbers and displaying that using multidimensional arrrays.   Hello Friend, Try this:ADS_TO_REPLACE_1 <script> function
arrays
arrays  using arrays in methods   Java use arrays in methods import java.util.*; class ArrayExample{ public static int getMaxValue(int[] arr){ int maxValue = arr[0]; for(int i=1;i < arr.length;i
Advertisements
arrays
Store a table with students and information (name, ID, password, crypted password, etc) in a multi-dimensional array "stud"  Arrays and Strings: Store a table with students and information (name, ID, password, crypted password
Arrays
Arrays   Hi I need help with the following exercises. Exercise 1: Write a Java application in which the user is prompted for the total number of integer values to be stored in an array. Initialize the array with random values
Arrays
called Rebel.java; 2.Create two arrays. One of them must store integer numbers... the numbers in the second array by 3; 7.Print out the contents of both arrays. 8.Swap
Multidimensional Array in PHP - PHP
Multidimensional Array in PHP  The concept of Multidimensional Array in PHP completely goes over my head. Can any one present a better explanation on it with an example? Also the structure of Multidimensional Array in PHP. 
JavaScript array multidimensional
the arrays object as parameter. Finally a new multidimensional table is created... JavaScript array multidimensional In this Tutorial we want to describe you a code that help you in understanding JavaScript array multidimensional
java multidimensional array - Java Beginners
java multidimensional array  i have two arrays which will take numbers and no. of rows and columns fron method getArr() ifter that i want to ensure when no. of rows of first array = no. of rows of second matrix (and columns also
MultiDimensional Array - Java Beginners
MultiDimensional Array  Hello Sir, How i can display Multiplication Table of 1 to 10 by Using Multidimensional Array in java  Hi Friend, Try the following code: public class MultiplicationTable{ public static
ModuleNotFoundError: No module named 'multidimensional_urlencode'
ModuleNotFoundError: No module named 'multidimensional_urlencode'  Hi...: No module named 'multidimensional_urlencode' How to remove the ModuleNotFoundError: No module named 'multidimensional_urlencode' error? Thanks
ModuleNotFoundError: No module named 'multidimensional_urlencode'
ModuleNotFoundError: No module named 'multidimensional_urlencode'  Hi...: No module named 'multidimensional_urlencode' How to remove the ModuleNotFoundError: No module named 'multidimensional_urlencode' error? Thanks
multidimensional data cube - Java Beginners
multidimensional data cube  how to create multidimensional data cube in java  Hi friend, A data warehouse comprises a multidimensional data storage area to store multidimensional data and a transactional data
how to store jtable value in multidimensional array?
how to store jtable value in multidimensional array?   i want to store the value of jtable in multidimensional array,with type double. how to store jtable value in multidimensional array
how to store jtable value in multidimensional array?
how to store jtable value in multidimensional array?   i want to store the value of jtable in multidimensional array,with type double. how to store jtable value in multidimensional array
Arrays in java
Arrays in java  what is param array in java
JavaScript array multidimensional
JavaScript array multidimensional   ... that help you in understanding JavaScript array multidimensional. For this we are using JavaScript language, This code illustrate a multidimensional array
java arrays
java arrays  can i know how can we intilize the three dimentional arrays in java? and how can we assign thae values to that array
java arrays
java arrays  i need a java program to store student details like id,name,addr,marks,average,total..using arrays..input data using scanner class and by using class, object and constructor
Php Array Multidimensional
In the Multidimensional array, elements of the array are itself array Multidimensional array can be two dimensional or multidimensional array PHP Multidimensional Array Example <?php     $nature=array
Multidimensional Array Java
;HEAD> <TITLE>Multidimensional Arrays in Jsp</TITLE> <...;>Multidimensional Arrays in Jsp</FONT> <% int TwoArray...Multidimensional Array Java     
Java with Arrays
Java with Arrays  I was given the assignment to create two parallel arrays; both of size 50 (declares 50 as a constant) One is an array of strings... and store it in the arrays. The input for the problem should be provided in a text
arrays
Arrays
Arrays
arrays
arrays
Arrays
arrays
arrays
arrays
Arrays
arrays
arrays
arrays
create arrays in JavaScript
create arrays in JavaScript  How to create arrays in JavaScript
How to create arrays in JavaScript?
How to create arrays in JavaScript?  How to create arrays in JavaScript
Compare two Byte Arrays?
Compare two Byte Arrays?  Compare two Byte Arrays
Comparing arrays not working correctly?
Comparing arrays not working correctly?  Comparing arrays not working correctly
java arrays
java arrays  how do you write the code for multipliying 2 double arrays to be in a 3rd double array? here is my code: package employeepay; /** * * @author Owner */ public class Main {ADS_TO_REPLACE_1 /** * @param args
ModuleNotFoundError: No module named 'Arrays'
ModuleNotFoundError: No module named 'Arrays'  Hi, My Python... 'Arrays' How to remove the ModuleNotFoundError: No module named 'Arrays'... to install padas library. You can install Arrays python with following command
arrays in java - Java Beginners
arrays in java  Hi All, I have two arrays. in this two array some name are same. I want to merge those arrays into single. But while merging I want to delete duplicate entries. How merge those arrays. Thanks, mln15584
java; arrays - Java Beginners
java arrays example  How can you create a program, by using arrays and the output would be X. by using char or string.Thank you
What is javascript Arrays?
What is javascript Arrays?   Hi, I am learner of JavaScript. My question is that What is JavaScript Arrays ? How to Define the JavaScript arrays in you program. Please give an example show that i will try my self. Thanks
Are arrays primitive data types?
Are arrays primitive data types?   Hi, Are arrays primitive data types? thanks   Hi, In Java, Arrays are objects. Identifier are some simple variable names which is defined as the value container. The type of value
combine two arrays in php
combine two arrays in php  combine two arrays in php   $newArray = array_combine($diff, $pages_name['data']); foreach ($newArray as $data) { var_dump($data); exit('zzzzz'); echo $data . '<br>
Arrays in java 7
This tutorial describes the concept of Arrays in java 7
PHP Push MultiDimensional Array
PHP Push MultiDimensional Array  This tutorial exemplifies how to push a multi-dimensional array into another array, a single element into an array, and so on. These all process are done by array_push() function. array_push
swap two integer arrays
swap two integer arrays  int [] array1 = {1,2,3,4,5} int [] array2 = {6,7,8,9,10} how can we swap the values of bith integer arrays results like this array1 = {6,7,8,9,10} array2 = {1,2,3,4,5
swap two integer arrays
swap two integer arrays  int [] array1 = {1,2,3,4,5} int [] array2 = {6,7,8,9,10} how can we swap the values of bith integer arrays results like this array1 = {6,7,8,9,10} array2 = {1,2,3,4,5
swap two integer arrays
swap two integer arrays  int [] array1 = {1,2,3,4,5} int [] array2 = {6,7,8,9,10} how can we swap the values of bith integer arrays results like this array1 = {6,7,8,9,10} array2 = {1,2,3,4,5

Ads