Bench Lab · spring preview 1 of 3

A look at the spring

Spring preview: a while loop. The lines inside the braces run again and again, as long as the condition is true. Trace it one pass at a time. No credit code here: this is a look ahead.

Job 1. Round and round

Each time line 4 or line 5 runs, fill a row. Line 2 checks count <= 3 before every pass.

int count = 1;
while (count <= 3)
{
System.out.println("Line " + count);
count++;
}
LinecountOutput
1

Write the value in each box after the line runs. Leave a box empty if nothing is stored in it yet, and the Output box empty if the line prints nothing.