Print Array Elements in Reverse Order

Practice Easy Programming problems here...
User avatar
xpl0it
Admin
Admin
Posts: 116
Joined: Mon May 08, 2017 1:36 am
Location: 127.0.0.1
x 31
x 8
Contact:

Print Array Elements in Reverse Order

#1

Unread post by xpl0it » Wed Jun 14, 2017 3:39 pm

Task
Given an array, A , of N integers, print A's elements in reverse order as a single line of space-separated numbers.

Input Format

The first line contains an integer, N(the size of our array).
The second line contains N space-separated integers describing array A's elements.

Constraints

1<=N<=1000
1<=Ai<=10000, where Ai is the ith integer in the array.

Output Format

Print the elements of array A in reverse order as a single line of space-separated numbers.

Sample Input

4
1 4 3 2

Sample Output

2 3 4 1
0 x

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest