| preferred AP College board partner for AP classes
AP Computer Science A/Unit 4: Iteration
Start Practice TestPractice Test
About Exam
medium Solved by 8 students
For Loop With Compound Conditional
< Prev
Next >

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)

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1hitrishabhatia11 0m 00s 100
#2sgarv251311 0m 00s 100
#3midnightasdark12 0m 42s 48
#4mahmoudjibrin0812 0m 53s 37
#5y.seong202712 1m 33s -3
#6psak1201 2m 31s -161
#7suhanakochhar00601 2m 54s -184
#8gtsak3101 3m 40s -230
#9Pelisx11 7m 11s -331
Items per page:
10
1 – 9 of 9
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy