Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
easy Solved by 3 students

Nested For Loop Iteration Count

< Prev
Next >

How many times will the println statement be executed by the following code segment?

for (int i = 1; i <= 3; i++) {
    for (int j = i; j <= 5; j++) {
        System.out.println(i + "-" + j);
    }
}
A

12

B

11

C

9

D

10

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1singhris00011 0m 49s 51
#2namansoin00011 1m 01s 39
#3bommasam00036 4m 09s 21
#4chasequest801 0m 03s -13
#5richa.tuli01 0m 25s -35
Items per page:
10
1 – 5 of 5
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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