-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLetsC.java
More file actions
27 lines (27 loc) · 705 Bytes
/
LetsC.java
File metadata and controls
27 lines (27 loc) · 705 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
import java.util.*;
public class LetsC
{
public static void main()
{
Scanner as = new Scanner(System.in);
int[][]a;
int i,j;
System.out.println("Enter the Size of The Square Matrix:");
int n=as.nextInt();
a=new int[n][n];
System.out.println("Enter the Numbers in the Array:");
for(i=0;i<n;i++)
{
System.out.println("Row:"+(i+1));
for(j=0;j<n;j++)
a[i][j]=as.nextInt();
}
System.out.println("The Array:");
for(int[] r : a) {
for (int c : r) {
System.out.print(c + " ");
}
System.out.println();
}
}
}