Reverse Array Traversal
What is printed to the console when the program is executed?
public class ReversePrint {
public static void main(String[] args) {
int[] arr = {1, 2, 3, 4, 5};
for (int i = arr.length - 1; i >= 0; i--) {
System.out.print(arr[i]);
}
}
}
A
15243
B
5432
C
12345
D
54321
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | bommasam000 | 5 | 5 | 2m 46s | 334 |
| #2 | winstonhou1107 | 1 | 1 | 0m 15s | 85 |
| #3 | 30006661 | 1 | 1 | 0m 18s | 82 |
| #4 | tfvhygdj | 1 | 1 | 0m 25s | 75 |
| #5 | vempaami000 | 1 | 1 | 0m 31s | 69 |
| #6 | kshiva2009m | 1 | 1 | 0m 31s | 69 |
| #7 | singhris000 | 1 | 1 | 0m 35s | 65 |
| #8 | sathilak000 | 1 | 1 | 0m 39s | 61 |
| #9 | y.seong2027 | 1 | 2 | 0m 39s | 51 |
| #10 | suhanakochhar006 | 1 | 1 | 1m 19s | 21 |
APFIVE