We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int arr[10];
int x ;
cin>>x;
int siz = sizeof(arr)/sizeof(int);
for(int i=0;i<=siz-1;i++)
{
cin>>arr[i];
}
int front =0,rear =siz-1;
while(front<rear)
{
swap(arr[front],arr[rear]);
front++;
rear--;
}
for(int i=0;i<=siz-1;i++)
{
cout<<arr[i]<<" ";
}
return 0;
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays Introduction
You are viewing a single comment's thread. Return to all comments →
include
include
include
include
include
using namespace std;
int main() {
}