Java Program to initialize 2d Array

Java Program to initialize 2d Array public static void main(String[] args) { Scanner x=new Scanner(; int rows,column; System.out.println(“Enter the Rows of Array”); rows=x.nextInt(); System.out.println(“Enter the Column of Array”); column=x.nextInt(); int arr[][]=new int[rows][column]; int num=0; for(int i=0;i<rows;i++) { for(int j=0;j<column;j++) { System.out.println(“Enter ” + num + ” Element “); num++; arr[i][j]=x.nextInt(); } } for(int i=0;i<rows;i++) { […]

Continue Reading