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

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
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.