| preferred AP College board partner for AP classes
AP Computer Science A/Unit 6: Array
Start Practice TestPractice Test
About Exam
medium Solved by 10 students
Nested Loop Iteration Count
< Prev
Next >

What is the total number of times the body of the inner loop will be executed in the following code segment?

for (int i = 0; i < 4; i++) {
    for (int j = i; j < 4; j++) {
        System.out.print(j);
    }
}
A

12

B

8

C

9

D

10

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
#1bommasam00044 1m 34s 306
#2theofanusmischa11 0m 00s 100
#3singhris00011 2m 25s -45
#4suhanakochhar00601 2m 03s -133
#5geethasailaja14 6m 19s -309
#6y.seong202713 6m 29s -309
#7midnightasdark24 8m 21s -321
#8sailajavadlamani3301 7m 51s -481
Items per page:
10
1 – 8 of 8
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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