Section 7.13 Loops-WE6-P1
Subgoals for Evaluating a Loop.
Subsection 7.13.1
Exercises Exercises
2.
Q16: What is the output of the following loop?
for (int m = 0; m < 4; m++)
{
for (int n = 0; n <= m; n++)
{
System.out.print("$");
}
System.out.println();
}

- 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
3.
Q17: What is the output of the following loop?
for (int m = 1; m < 5; m++)
{
for (int n = 1; n <= m; n++)
{
System.out.print(" ");
}
System.out.println("$");
}

- 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
You have attempted 1 of 3 activities on this page.