Decrementing For Loop
What is printed when the following code segment is executed?
public class ReverseFor {
public static void main(String[] args) {
for (int i = 3; i >= 1; i--) {
System.out.print(i);
}
}
}
A
321
B
3 2 1
C
123
D
Compilation Error
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | hitrishabhatia | 2 | 2 | 0m 00s | 200 |
| #2 | busemagngr | 1 | 1 | 0m 26s | 74 |
| #3 | meromaroseif | 1 | 2 | 1m 05s | 25 |
Items per page:
10
1 – 3 of 3
