• + 0 comments

    Simple and easy to understand-

    public class Solution { public static void main(String[] args) throws IOException {

        //import scanner that is scan
    
            Scanner scan = new Scanner(System.in);
    
                        //input n
    
            int n = scan.nextInt();
    
                        //array initialize
    
        int[] arr = new int[n];
    
                // for loop for array
    
        for(int i=0; i<n; i++){
            arr[i] = scan.nextInt();
        }    
    
                // for loop for reversing which will print the input in reversed order
    
    
        for(int i = n-1; i>=0;i--){
            System.out.print(arr[i]+ " ");
        }
    
        scan.close();
    }
    

    }****