-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYT52.java
More file actions
36 lines (27 loc) · 849 Bytes
/
YT52.java
File metadata and controls
36 lines (27 loc) · 849 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
26
27
28
29
30
31
32
33
34
35
36
/*Basic Array 2D Concept: Filling & Print */
import java.io.*;
public class YT52 {
public static void main(String[] args)throws IOException {
int a[][] = new int[4][4];
InputStreamReader I = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(I);
System.out.println("Enter the array 4x4: ");
for(int i=0; i<4; i++)
{
for(int j=0; j<4; j++)
{
a[i][j]=Integer.parseInt(br.readLine());
}
}
//printing
System.out.println("Array: ");
for(int i=0; i<4; i++)
{
for(int j=0; j<4; j++)
{
System.out.print(a[i][j]+" ");
}
System.out.println();
}
}
}