[Solved] 2D Array number grid with for and if
The difference between the two elements in a column is 9: a[i][j] = a[i-1][j] + 9, thus the code may be modified as: public static void main(String args[]) { int array[][] = new int[6][5]; // initialize the first row array[0] = new int[] {1, 2, 3, 5, 7}; // print the first row System.out.println(Arrays.toString(array[0])); for … Read more