| preferred AP College board partner for AP classes
AP Computer Science A/Unit 1: Primitive Types
Start Practice TestPractice Test
About Exam
medium Solved by 25 students
Nested For Loop Iterations
< Prev
Next >

In the code segment below, what is the total number of times the body of the inner for loop is executed?

for (int i = 0; i < 4; i++){
    for (int j = i; j < 4; j++){
         // Loop Body
    }
}
A

10

B

9

C

7

D

8

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
#1michael.2103ll22 0m 00s 200
#2varunrajaram111 0m 00s 100
#3alchemax04311 0m 38s 62
#4kazvin.tjakradinata11 0m 47s 53
#5leftoverjluck11 0m 50s 50
#6lsj0803092211 1m 00s 40
#7bommasam00014 0m 54s 16
#8parth.taur22711 1m 44s -4
#9songqiuhui201201 0m 06s -16
#10701704612 1m 59s -29
Items per page:
10
1 – 10 of 16

AI Tutor

How can I help?

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