The core code of this algorithm is:
int I = j = k = 0;
//loop comparison, insert the small one into the c array.
While (I<3 & amp& ampj & lt3) {
if(a[I]& lt; b[j])c[k++]= a[i++];
else c[k++]= b[j++];
}
//Process one of the arrays.
While (I<3) c [k++] = a [I++];
while(j & lt; 3)c[k++]= b[j++];
Maybe there is a better realization, think for yourself!