The problem
Write a program that reads ten integers and displays them in the reverse of the order in which they were read.
Breaking it down
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter ten integers: ");
int[] n = new int[10];
for (int i = 0; i < 10; i++) {
n[i] = input.nextInt();
}
input.close();
for (int i = n.length - 1; i >= 0; i--) {
System.out.print(n[i] + " ");
}
}
Output
Enter ten integers: 77
66
44
888
33
555
44
88
99
11
11 99 88 44 555 33 888 44 66 77