-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayTDExp.java
More file actions
36 lines (31 loc) · 929 Bytes
/
ArrayTDExp.java
File metadata and controls
36 lines (31 loc) · 929 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
import java.util.*;
import java.io.*;
//Two Dimensonal Array using user input
public class ArrayTDExp {
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter Size of Row : ");
int row =sc.nextInt();
System.out.print("Enter Size of Column : ");
int col = sc.nextInt();
int matrix[][] = new int[row][col];
System.out.println("Enter Data in Matrix : ");
for(int i = 0;i<row;i++)
{
for(int j =0;j<row;j++)
{
matrix[i][j] = sc.nextInt();
}
}
System.out.println("Data in Matrix : ");
for(int i = 0;i<row;i++)
{
for(int j =0;j<row;j++)
{
System.out.print(matrix[i][j] + " ");
}
System.out.println();
}
}
}