Answer:

count = count + 1;

It increases count by one.

If this is not clear, remember the two steps of an assignment statement: first evaluate the expression on the right of the equal sign, second put the value in whatever variable is on the left. Say that count is 5. When the above statement executes, first the expression is evaluated, resulting in 6. Second the 6 is put in count.

Live Loop

while loop

 

Here is a simulation (using JavaScript) of the loop. Click on the "run program" button to see the output of the loop. Examine the flowchart to see how the looping has been done.





If you look at the source for this page using your browser's "View Source" menu item, you will see the JavaScript that is responsible for the above. JavaScript is similar to Java, but has some big differences, so be careful not to get confused.


 

QUESTION 3:

If the "3" where changed to a "10" how many times would the program loop?