Code:

#include<stdio.h>
#include<conio.h>
void bubble_sort(int array[],int w);
void merge(int array1[], int w1, int array2[], int w2);
int main(void)
{
int val_1,i,x,val_2,y,z, size1, size2;
int array1[10] = {4,8,1,9,6,3,2,5};
int array2[10] = {1,5,2,9,4,3};
i = 0;
while(array1[i++]);
size1 = i - 1;
i = 0;
while(array2[i++]);
size2 = i - 1;
printf("\n\nsize1: %d size2: %d", size1, size2);
getch();
bubble_sort(array1, size1);
bubble_sort(array2, size2);
printf("\n\nThe sorted elements of Values1 are: ");
for(i = 0; i < size1; i++)
printf("%d",array1[i]);
printf("\n");
printf("\nThe sorted elements of Values2 are: ");
for(i = 0; i < size2; i++)
printf("%d",array2[i]);
merge(array1,size1, array2, size2);
getch();
return 0;
}
void bubble_sort(int array[],int w)
{
int c1,c2,hold;
for (c1 = 0; c1 < w-1; c1++)
{
for (c2 = c1+1; c2 < w; c2++)
{
if (array[c1] > array[c2])
{
hold = array[c1];
array[c1] = array[c2];
array[c2] = hold;
}
}
}
}
void merge(int array1[], int w1, int array2[], int w2)
{
int f, n1, n2 ,array3[20];
for(n1 = 0, n2 = 0; n1 < w1 || n2 < w2; )
{
//logic for the tips of arrays of different sizes
if(n1 >= w1) {
array3[n1+n2] = array2[n2];
++n2;
continue;
}
else if(n2 >= w2) {
array3[n1+n2] = array1[n1];
++n1;
continue;
}
//end of logic for tips of arrays with different sizes
//this if statement handles all the rest
if(array1[n1] < array2[n2])
{
array3[n1+n2] = array1[n1];
++n1;
}
else if(array2[n2] <= array1[n1])
{
array3[n1+n2] = array2[n2];
++n2;
}
}
printf("\n\nThe final values are:\n");
for(f = 0; f < (w1+w2); f++)
{
printf("%d ",array3[f]);
}
}

This is just slightly tested, so play around with it and see if it breaks!