-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopyarry.java
50 lines (48 loc) · 1.32 KB
/
copyarry.java
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.util.*;
class copyarray
{
public static void main(String[] args)
{
int a1[][] = new int[10][10];
int a2[][] = new int[10][10];
Scanner s=new Scanner(System.in);
int row,column;
System.out.print("ENTER THE MARTIX ROW:");
row=s.nextInt();
System.out.print("ENTER THE MATRIX COLUMN:");
column=s.nextInt();
System.out.println("EMNTER THE MATRIX");
for(int i=0;i<row;i++)
{
for(int j=0;j<column;j++)
{
a1[i][j]=s.nextInt();
}
}
for (int i = 0; i < row; i++)
{
for(int j=0;j<column;j++)
{
a2[i][j] = a1[i][j];
}
}
System.out.println("ELEMENT THE ORIGINAL ARRAY:");
for(int i=0;i<row;i++)
{
for(int j=0;j<column;j++)
{
System.out.print(a1[i][j]+" ");
}
System.out.println();
}
System.out.println("ELEMENT THE NEW ARRAY ");
for(int i=0;i<row;i++)
{
for(int j=0;j<column;j++)
{
System.out.print(a2[i][j]+" ");
}
System.out.println();
}
}
}