For Loop Execution Trace
What output is produced by the following code segment?
for (int i = 1; i < 100; i = i * 2)
{
if (i / 50 == 0)
System.out.print(i + " ");
}
A
1 2 4 8 16 32
B
1 2 4 8 16 32 64
C
2 4 8 16 32 64
D
2 4 8 16 32
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | hitrishabhatia | 1 | 1 | 0m 00s | 100 |
| #2 | sgarv2513 | 1 | 1 | 0m 00s | 100 |
| #3 | y.seong2027 | 1 | 2 | 0m 49s | 41 |
Items per page:
10
1 – 3 of 3
APFIVE