For Loop With Compound Conditional
Consider the following method definition in a class Processing:
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 will cause "0 6 12 " to be printed?
A
evaluate(5, 6)
B
evaluate(20, 6)
C
evaluate(15, 6)
D
evaluate(12, 6)
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | sgarv2513 | 1 | 1 | 0m 00s | 100 |
| #2 | hitrishabhatia | 1 | 1 | 0m 00s | 100 |
| #3 | mahmoudjibrin08 | 1 | 2 | 0m 53s | 37 |
| #4 | y.seong2027 | 1 | 2 | 1m 33s | -3 |
| #5 | psak12 | 0 | 1 | 2m 31s | -161 |
| #6 | suhanakochhar006 | 0 | 1 | 2m 54s | -184 |
| #7 | gtsak31 | 0 | 1 | 3m 40s | -230 |
APFIVE