int a[]={1,2,3,4,5,6}; int start=0; int end=5; while(start<end) swap(a[start++],a[end--]); for (auto i=0;i<6;i++) cout<<a[i];