• + 0 comments
    public class Solution {
        public static void main(String[] args) {
                Scanner sc = new Scanner(System.in);
    
            int s = sc.nextInt();   // Read the size of the array
            int [] array = new int [s];
    
            for (int a = 0;a < s;a++)          // Reading input values into the array
    
            {
                array [a] = sc.nextInt();
            }
            int pd = s - 1;
            for (int l = pd; l >= 0; l--) {                   // Print the array in reverse order
    
                    System.out.print(array[l] + " ");
                }
               
        }
    }