-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment_5.java
More file actions
25 lines (22 loc) · 818 Bytes
/
Assignment_5.java
File metadata and controls
25 lines (22 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.util.Scanner;
public class Two_Dimension {
public static void main(String[] args) {
int[][] array = new int[11][11];
Scanner input = new Scanner(System.in);
System.out.println("INPUT 100 NUMBERS FOR 2D ARRAY");
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array[i].length; j++) {
System.out.print("Enter a number for row " + i + ", and column " + j + ": ");
array[i][j] = input.nextInt();
}
}
System.out.println("\nYou entered the following numbers");
for (int[] row : array) {
for (int num : row) {
System.out.print(num + " ");
}
System.out.println();
}
input.close();
}
}