#include #include #include using namespace std; void mergeAndSortArrays(vector& arr1, vector& arr2) { vector mergedArray; mergedArray.insert(mergedArray.end(), arr1.begin(), arr1.end()); mergedArray.insert(mergedArray.end(), arr2.begin(), arr2.end()); sort(mergedArray.begin(), mergedArray.end()); cout << "Merged and sorted array: "; for (int num : mergedArray) { cout << num << " "; } cout << endl; } int main() { vector arr1 = {3, 1, 4, 5}; vector arr2 = {8, 2, 6, 7}; mergeAndSortArrays(arr1, arr2); return 0; }