#include<stdio.h>
#include<conio.h>
#define size
main()
{
int arr1[size],arr2[size],arr3[size+size],i,j,temp=0,no,num,k=0;
printf("Enter number of element in array first:\t");
scanf("%d",&no);
printf("\nEnter element of array first:\n");
for(i=0;i<no;i++)
{
scanf("%d",&arr1[i]);
}
printf("\nEnter number of element in array second:\t");
scanf("%d",&num);
printf("\nEnter element of array second:\n");
for(i=0;i<num;i++)
{
scanf("%d",&arr2[i]);
}
printf("\n element of array first:\n");
for(i=0;i<no;i++)
{
printf("%d ",arr1[i]);
}
printf("\n element of array second:\n");
for(i=0;i<num;i++)
{
printf("%d ",arr2[i]);
}
for(i=0;i<no+num;i++)
{
k=0;
if(i>no-1)
{
arr3[i]=arr2[k];
k++;
}
arr3[i]=arr1[i];
}
printf("\n mearg element of array first and second are:\n");
for(i=0;i<no+num;i++)
{
printf("%d ",arr3[i]);
}
printf("\nsorted array3 are\n");
for(i=0;i<no+num;i++)
{
for(j=i+1;j<no+num+1;j++)
{
if(arr3[j]>arr3[i])
{
temp=arr3[i];
arr3[i]=arr3[j];
arr3[j]=temp;
}
}
}
for(i=0;i<no+num;i++)
{
printf("%d ",arr3[i]);
}
getch();
return 0;
}