Friday, February 13, 2015

Five Per Line. java in pgm



FivePerLine.java

public class FivePerLine
{

   public static void main(String[] args)
 {
                   int start = 1000, end = 2000;
       for (int i = start; i <= end; i++)
       {
          System.out.print(i + " ");
          if (i % 5 == 4) System.out.println();
       }
       System.out.println();
                   }
}

No comments:

Post a Comment