A good answer might be:

count is 0
count is 1
count is 2
count is 3
count is 4
Done with the loop

Complete Program

Here is a complete program that lets the user pick the initial value and the limit value:

import java.io.*;
// User picks starting and ending value
class loopExample
{
  public static void main (String[] args ) throws IOException
  {
    BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    String inputData;
    int count, limit;

    System.out.println( "Enter initial value:" );
    inputData = stdin.readLine();
    count     = Integer.parseInt( inputData );

    System.out.println( "Enter limit   value:" );
    inputData = stdin.readLine();
    limit     = Integer.parseInt( inputData );

    while ( count <= limit )   // less-than-or-equal operator
    {
      System.out.println( "count is:" + count );
      count = count + 1;
    }
    System.out.println( "Done with the loop" );
  }
}

Of course, you will want to copy this into NotePad and run this in the usual way.

QUESTION 9:

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