Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What does a nested loop do in Java?
Think about how many loops you see.
How many lines will the outer loop iterate if it runs from 1 to 5?
Count the numbers from 1 to 5.
How many times will the outer loop run in the example triangle printing program?
Count how many iterations the outer loop is set.
The inner loop's execution is determined by which variable?
Which loop affects the other?
Create a program that uses nested loops to print a series of increasing and decreasing triangles. How would you implement this?
Consider different conditions for the outer loop.
Modify the triangle printing example to also print each line number preceding the stars. How would that affect your nested loop?
What additional output do you need to include inside the outer loop?
5 more questions in this section. Enroll free to practise them all.
Enroll free