You are on page 1of 1

package java2darray;

import java.util.Scanner;
public class Java2DArray {
public static void main(String[] args) {
int row, column, i, j;
int arr[][] = new int[10][10];
Scanner input = new Scanner(System.in);

System.out.print("Enter Number of Row for Array (max 10) : ");


row = input.nextInt();
System.out.print("Enter Number of Column for Array (max 10) : ");
column = input.nextInt();

System.out.println("Enter " +(row*column)+ " Array Elements : ");

for(i=0; i < row; i++) {


for(j=0; j<column; j++)
{
arr[i][j] = input.nextInt();
}
}
System.out.print("The Array is :\n");
for(i=0; i<row; i++) {
for(j=0; j<column; j++)
{
System.out.print(arr[i][j]+ " ");
}
System.out.println();
}
}

You might also like