data structures using if we have two sorted arrays and the resultant merged array also needs to be sorted onethen the task of merging the arrays becomes little difficult the task of merging can be explained using fig array array array figure merging of two sorted arrays figure shows how the merged array is formed using two sorted arrays herewe first compare the st element of array with the st element of array and then put the smaller element in the merged array since we put as the first element in the merged array we then compare the nd element of the second array with the st element of the first array since now is stored as the second element of the merged array nextthe nd element of the first array is compared with the nd element of the second array since we store as the third element of the merged array nowwe will compare the nd element of the first array with the rd element of the second array because we store as the th element of the merged array this procedure will be repeated until elements of both the arrays are placed in the right location in the merged array programming example write program to merge two sorted arrays #include #include int main(int arr [ ]arr [ ]arr [ ]int in mindex= int index_first index_second clrscr()printf("\ enter the number of elements in array ")scanf("% "& )printf("\ \ enter the elements of the first array")for( = ; < ; ++printf("\ arr [% " )scanf("% "&arr [ ])printf("\ enter the number of elements in array ")scanf("% "& )printf("\ \ enter the elements of the second array")for( = ; < ; ++printf("\ arr [% " )scanf("% "&arr [ ]) + while(index_first &index_second