Code Below:


import java.util.*;
class ArrayRev
{
    public static void main()
    {
        Scanner s= new Scanner(System.in);
        int arr[]=new int[10];
        int i;
        System.out.println("Enter 10 nos.");
        for (i=0;i< 10;i++)
        {
            arr[i]=s.nextInt();
        }
        System.out.println("Before Rev");
        for (i=0;i< 10;i++)
        {
            System.out.print(arr[i]+",");
        }
        for (i=0;i< 5;i++)
        {
            arr[i]=arr[i]+arr[9-i];
            arr[9-i]=arr[i]-arr[9-i];
            arr[i]=arr[i]-arr[9-i];
        }
        System.out.println("/nAfter Rev");
        for (i=0;i< 10;i++)
        {
            System.out.print(arr[i]+",");
        }
    }
}