If the user sets the initial value to -2 and the limit value to 1 what values will be printed out?

A good answer might be:

count is: -2
count is: -1
count is: 0
count is: 1

Zero is included in the list of values!


Web Page Version of the Program

You might enjoy playing with this JavaScript version of the program. Try a variety of initial and limit values. If the output does not fit into the text area, use the "scroll bar" on the right to move up and down through the output. The loop in this program is:


// user enters values for count and limit
while ( count <= limit ) 
{
  System.out.println( "count is:" + count );
  count = count + 1;
}
System.out.println( "Done with the loop" );
Enter initial value:        Enter limit value:

QUESTION 10:

Try entering an initial value of 9 and a limit value of 4. What happens? Why?