public class Test2 { public static void main(String [] args) { int baseAddress = 0; int [][] a = new int [7][7]; for (int i = 0; i <= 6; ++i) for (int j = 0; j <= 6; ++j) { int address = baseAddress + 4 * (7*i + j); int pageNumber = address / 32; System.out.printf("%d ", pageNumber); } System.out.printf("\n"); // You need three more sets of nested loops like the one above. } }