#include <algorithm>
#include <iostream>
using namespace std;
int main()
{
int array[]={1, 2};
cout<<array[0]<<" "<<array[1]<<endl;
swap(array[0], array[1]);
cout<<array[0]<<" "<<array[1];
return 0;
}
// Funtion that swaps array values
void swap(int &a, int &b){
int temp = a;
a = b;
b = temp;
}
// the "&" is very important, since arrays are not mutable we
// use this operator to swap memory addresses