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 main() {
int size;
scanf("%d", &size);
int arr[size];
for (int i = 0; i < size; i++) {
scanf("%d", &arr[i]);
}
for (int i = size - 1; i >= 0; i--) {
printf("%d ", 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
Array Reversal
You are viewing a single comment's thread. Return to all comments →
include
int main() { int size; scanf("%d", &size); int arr[size]; for (int i = 0; i < size; i++) { scanf("%d", &arr[i]); } for (int i = size - 1; i >= 0; i--) { printf("%d ", arr[i]); } return 0; }