Write a program to create 2 arrays in order to store 5 numbers and 6 numbers respectively. Then merge those values of both the array into third array so that the values of the first array will be kept first from left to right followed by values of second array again from left to right. Then display those values of the merged array.
import java.util.*;
class A {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int a[] = new int[5];
int b[] = new int[6];
int i,n,m,p;
System.out.println("Enter numbers in first array");
n = sc.nextInt();
System.out.println("Enter numbers in second array");
m = sc.nextInt();
Continue from here: merging values of both arrays into third array and then displaying values of the first array in first from left to right followed by values of second array again from left to right & then values of the merged array.
Comments
Leave a comment