Buggy4FivePerLine.java


Below is the syntax highlighted version of Buggy4FivePerLine.java.


/*********************************************************************
 * 
 *  Print the integers from 1000 to 2000, 5 per line.
 *
 **********************************************************************/




public class Buggy4FivePerLine { 
    public static void main(String[] args) { 
        int i;
        // print integers from 1000 to 2000, 5 per line
        for (i = 1000; i >= 2000; i++) {
            for (int j = 0; j < 5; j+=1) 
                System.out.print(i +  j + " ");
           
            System.out.println();
        }
        System.out.println(i);
    }
}