-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMerge_Matrix.java
More file actions
32 lines (32 loc) · 815 Bytes
/
Copy pathMerge_Matrix.java
File metadata and controls
32 lines (32 loc) · 815 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
import java.util.Scanner;
class Merge_Matrix
{
public static void main(String args[])
{
int k,x,d=0;
Scanner sc=new Scanner(System.in);
System.out.println("enter 2 limits");
k=sc.nextInt();
x=sc.nextInt();
int A[]=new int[k];
int B[]=new int[x];
int C[]=new int[k+x];
System.out.println("enter elements in a");
for(int i=0;i<k;i++)
A[i]=sc.nextInt();
System.out.println("enter elements in b");
for(int i=0;i<x;i++)
B[i]=sc.nextInt();
for(int i=0;i<k;i++)
{
C[d++]=A[i];
}
for(int i=0;i<x;i++)
{
C[d++]=B[i];
}
System.out.println("enter elements in c");
for(int i=0;i<k+x;i++)
System.out.print(C[i]);
}
}