Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
easy Solved by 3 students

While Loop Execution Trace

Mark
< Prev
Next >

What is printed when the following code segment is executed?

int sum = 0;
int num = 1;
while (sum < 20) {
    sum += num;
    num += 2;
}
System.out.println(sum);
A

24

B

25

C

21

D

20

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1hitrishabhatia11 - 100
#2raufyildirim9511 2m 30s -50
#3midnightasdark12 3h 00m -10,724
Items per page:
10
1 – 3 of 3
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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