C program to merge two arrays into another array. They are assumed to be sorted in ascending order. A user inputs them; the program combines them to get a larger array. If they aren't in ascending order, we can sort them and then use the merge function. Another method is to merge them first and then sort it. Sorting them first takes less time as compared to sorting a large array. Merging two sorted lists is used in the merge sort algorithm.
outputs:
Input number of elements in first array
2
Input 2 integers
1
2
Input number of elements in second array
2
Input 2 integers
1
2
Sorted array:
1
1
2
2
need an explanation for this answer? contact us directly to get an explanation for this answer