| preferred AP College board partner for AP classes
AP Computer Science A/Unit 6: Array
Start Practice TestPractice Test
About Exam
easy Solved by 4 students
For Loop Execution Count
< Prev
Next >

How many times is the statement ‘sum += i’ executed in the above code?

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

2

B

Infinite

C

3

D

4

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
#1bommasam00022 0m 35s 165
#2chunxiangxu.cxu11 0m 19s 81
#3winstonhou110711 0m 30s 70
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: [email protected]|Privacy Policy