Java For Loop Iteration Count
Consider the following code segment.
for (int k = 0; k < p; k += 2)
if (data[k] <= limit) System.out.println("LOW");
What is the maximum number of times that LOW can be printed as a result of executing this code?
A
p
B
p / 2
C
(p + 1) / 2
D
Cannot be determined from the information given
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | hitrishabhatia | 1 | 1 | 0m 00s | 100 |
| #2 | busemagngr | 1 | 2 | 0m 50s | 40 |
| #3 | y.seong2027 | 1 | 2 | 1m 16s | 14 |
Items per page:
10
1 – 3 of 3
