Just put the "System.out.println("The merged array");" statement before the last for loop as:-

import java.util.*;
class a
{
public static void main(String args[])
{
int i,j;
int []a=new...