-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMerging.java
More file actions
32 lines (26 loc) · 830 Bytes
/
Merging.java
File metadata and controls
32 lines (26 loc) · 830 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.*;
class Merging {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int r, n, a[] = new int[10], b[] = new int[6];
for (r = 0; r < 10; r++) {
System.out.print("Enter in a: ");
a[r] = sc.nextInt();
}
for (r = 0; r < 6; r++) {
System.out.print("Enter in b: ");
b[r] = sc.nextInt();
}
int[] am = new int[16];
for (r = 0; r < a.length; r++)
am[r] = a[r];
n = 0;
for (r = 0; r < 6; r++)
am[r + a.length] = b[r];
System.out.println();
System.out.println();
System.out.println("After Merging");
for (r = 0; r < 16; r++)
System.out.println(am[r]);
}
}