import java.util.Arrays;
import java.util.Scanner;
public class RevArray {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the elements of an integer
Array = ");
int[] arr = new int[6];
for (int i = 0; i < 6; i++) {
arr[i] = sc.nextInt();
}
System.out.println("Your input Array is = ");
System.out.print(Arrays.toString(arr));
int start = 0;
int end = arr.length - 1;
while (start < end) {
swap(arr, start, end);
start++;
end
}
System.out.println("\nThe reversed array is = ");
System.out.println(Arrays.toString(arr));
}
static void swap(int[] arr, int start, int end) {
int temp = arr[start];
arr[start] = arr[end];
arr[end] = temp;
}
}