Section 7.14 Assessment: Nested Loops
Subgoals for Evaluating a Loop.
Exercises Exercises
- See diagram for answer A
- See diagram for answer B
- See diagram for answer C
- See diagram for answer D
- See diagram for answer E
2.
3.
Q3: What is printed as a result of executing the following code segment?
for (int r = 3; r > 0; r--) {
int c;
for (c = 1; c < r; c++)
System.out.print("-");
for (c = r; c <= 3; c++)
System.out.print("*");
System.out.println();
}

4.
5.
You have attempted 1 of 2 activities on this page.