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.
- Prepare
- C
- Arrays and Strings
- Array Reversal
- Discussions
Array Reversal
Array Reversal
Sort by
recency
|
834 Discussions
|
Please Login in order to post a comment
include
include
int main() { int num, arr, i; scanf("%d", &num); arr = (int) malloc(num * sizeof(int)); for(i = 0; i < num; i++) { scanf("%d", arr + i); }
}
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]);