#include using namespace std; // void Swap(int list[], int a, int b) same to the compiler void Swap(int * list, int a, int b) { int temp = list[a]; list[a] = list[b]; list[b] = temp; } //void PrintArray(const int list[], int size) same to the compiler void PrintArray(const int* list, int size) { for (int i = 0; i < size; i++) cout << list[i] << ' '; cout << '\n'; } int main() { int arr[5] = {2, 4, 6, 8, 10}; int arr2[10] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}; PrintArray(arr, 5); PrintArray(arr2, 10); Swap(arr, 3, 4); // I would like to swap slots 3 and 4 Swap(arr2, 4, 9); PrintArray(arr, 5); PrintArray(arr2, 10); }