For Loop With Post-Decrement Condition
How many iterations does the for-loop execute in the code above?
public class LoopExample20 {
public static void main(String[] args) {
int count = 0;
for (int i = 10; i-- > 5; ) {
count++;
}
System.out.println(count);
}
}
A
5
B
6
C
7
D
4
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE