#include <stdio.h>
#include <stdlib.h>
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);
}
/* Write the logic to reverse the array. */
for(i = num-1; i>-1; i--)
printf("%d ", *(arr + i));
return 0;
}
output:
6
16 13 7 2 1 12
12 1 2 7 13 16