Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 6: Array
Start Practice TestPractice Test
About Exam
easy Solved by 3 students

For Loop Execution Count

Mark
< Prev
Next >

Consider the following code segment. How many times is the statement sum += i; executed?

int sum = 0;
for (int i = 0; i < 3; i++)
    sum += i;
System.out.println(sum);
A

3

B

4

C

2

D

Infinite

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
#1bommasam00022 0m 35s 165
#2chunxiangxu.cxu11 0m 19s 81
#3winstonhou110711 0m 30s 70
Items per page:
10
1 – 3 of 3

AI Tutor

How can I help?

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