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 int[3];
int []b=new int[3];
int []c=new int[6];
Scanner sc=new Scanner(System.in);
System.out.println("Enter the elements of the first array");
for(i=0;i<=2;i++)
{
a[i]=sc.nextInt();
}
System.out.println("Enter the elements of the second array");
for(j=0;j<=2;j++)
{
b[j]=sc.nextInt();
}
for(i=0;i<=2;i++)
{
c[i]=a[i];
}
for(j=0;j<=2;j++)
{
c[i]=b[j];
i++;
}
System.out.println("The merged array");
for(i=0;i<=5;i++)
{
System.out.println(c[i]);
}
}
}
u will get what u r expecting.