public class PrintPrimes {
  static final int M = 300;
  static final int RR = 50;
  static final int CC = 4;
  static final int WW = 10;
  static final int ORDMAX = 30;

  public static void main(String[] args) {
    int P[] = new int[M + 1];
    int PAGENUMBER;
    int PAGEOFFSET;
    int ROWOFFSET;
    int C;
    int J;
    int K;
    boolean JPRIME;
    int ORD;
    int SQUARE;
    int N;
    int MULT[] = new int[ORDMAX + 1];

    J = 1;
    K = 1;
    P[1] = 2;
    ORD = 2;
    SQUARE = 9;

    while (K < M) {
      do {
        J = J + 2;
        if (J == SQUARE) {
          ORD = ORD + 1;
          SQUARE = P[ORD] * P[ORD];
          MULT[ORD - 1] = J;
        }
        N = 2;
        JPRIME = true;
        while (N < ORD && JPRIME) {
          while (MULT[N] < J)
            MULT[N] = MULT[N] + P[N] + P[N];
          if (MULT[N] == J)
            JPRIME = false;
          N = N + 1;
        }
      } while (!JPRIME);
      K = K + 1;
      P[K] = J;
    }
    {
      PAGENUMBER = 1;
      PAGEOFFSET = 1;
      while (PAGEOFFSET <= M) {
        System.out.println("The First " + M +
                             " Prime Numbers --- Page " + PAGENUMBER);
        System.out.println("");
        for (ROWOFFSET = PAGEOFFSET; ROWOFFSET < PAGEOFFSET + RR; ROWOFFSET++){
          for (C = 0; C < CC;C++)
            if (ROWOFFSET + C * RR <= M)
              System.out.format("%10d", P[ROWOFFSET + C * RR]);
          System.out.println("");
        }
        System.out.println("\f");
        PAGENUMBER = PAGENUMBER + 1;
        PAGEOFFSET = PAGEOFFSET + RR * CC;
      }
    }
  }
}

					 

@@ -245,142 +245,21 @@
     
-int PAGENUMBER;%0A    int PAGEOFFSET;%0A    int ROWOFFSET;%0A    int C;%0A    int J;%0A    int K;%0A    boolean JPRIME;%0A    int ORD;%0A    int SQUAR
+boolean JPRIM
 E;%0A 
@@ -307,24 +307,28 @@
  + 1%5D;%0A%0A    
+int 
 J = 1;%0A    K
@@ -322,24 +322,28 @@
  J = 1;%0A    
+int 
 K = 1;%0A    P
@@ -351,24 +351,28 @@
 1%5D = 2;%0A    
+int 
 ORD = 2;%0A   
@@ -368,24 +368,28 @@
 RD = 2;%0A    
+int 
 SQUARE = 9;%0A
@@ -874,24 +874,28 @@
     %7B%0A      
+int 
 PAGENUMBER =
@@ -900,24 +900,28 @@
  = 1;%0A      
+int 
 PAGEOFFSET =
@@ -1118,16 +1118,20 @@
    for (
+int 
 ROWOFFSE
@@ -1204,16 +1204,20 @@
    for (
+int 
 C = 0; C

Move variable declaration near its use