For Loop With Compound Conditional
Consider the following method.
public static void evaluate(int limit, int divisor) {
for (int j = 0; j < limit; j++) {
if (j % divisor == 0 && j % 3 == 0) {
System.out.print(j + " ");
}
}
}
Which of the following method calls produces the output "0 6 12 "?
A
evaluate(12, 6)
B
evaluate(15, 6)
C
evaluate(5, 6)
D
evaluate(20, 6)
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | hitrishabhatia | 1 | 1 | 0m 00s | 100 |
| #2 | sgarv2513 | 1 | 1 | 0m 00s | 100 |
| #3 | midnightasdark | 1 | 2 | 0m 42s | 48 |
| #4 | mahmoudjibrin08 | 1 | 2 | 0m 53s | 37 |
| #5 | y.seong2027 | 1 | 2 | 1m 33s | -3 |
| #6 | psak12 | 0 | 1 | 2m 31s | -161 |
| #7 | suhanakochhar006 | 0 | 1 | 2m 54s | -184 |
| #8 | gtsak31 | 0 | 1 | 3m 40s | -230 |
| #9 | Pelisx | 1 | 1 | 7m 11s | -331 |
Items per page:
10
1 – 9 of 9
APFIVE