import java.util.Scanner;
public class Reverse {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int arr[] = new int[5];
System.out.println("Enter the values in the array");
for (int i = 0; i < arr.length - 1; i++) {
arr[i] = sc.nextInt();
}
for (int i = 0; i < 5; i++) {
int temp;
int j = 4;
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
j--;
System.out.println(arr[i]);
}
}
}
This logic is not reversing the array of integers why?????
input 123
output is 0123