You are viewing a single comment's thread. Return to all comments →
int main(){
/* Enter your code here. Read input from STDIN. Print output to STDOUT */ int num; cin>>num; int arr[num]; for(int i=0;i<num;i++){ cin>>arr[i]; } int i,j; i=0; j=num-1; int temp; while(i<j){ temp=arr[i]; arr[i]=arr[j]; arr[j]=temp; i++; j--; } int len=sizeof(arr)/sizeof(arr[0]); for(int j=0;j<len;j++) { cout<<arr[j]<<" "; } return 0; }
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 →
int main(){