Print Array in Reverse

4

26 votes
Very-Easy
Problem

Given the size and the elements of array A, print all the elements in reverse order.

Input:
First line of input contains, N - size of the array.
Following N lines, each contains one integer, i{th} element of the array i.e. A[i].

Output:
Print all the elements of the array in reverse order, each element in a new line.

Constraints:

  • \(1 \le N \le 100\)
  • \(0 \le A[i] \le 1000\)
Sample Input
5
4
12
7
15
9
Sample Output
9
15
7
12
4
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?