I want to output table that shows row and column indexes [i][j] for every cell ,
I can only print i-index but don't know how to print "column" index
It should look like this:
for every column - there is indexes shown above - first horizontal line - 0 1 2 3 4 5 6 7 8 9 10
The code i have :
public static void print_table( int table[][] ){
System.out.println( "PRINTING TABLE ") ;
for(int i = 0; i <= NCHANGES; i++) {
System.out.print("[" + i + "]") ;// this prints i-index for EVERY ROW
for(int j = 0; j <= MAX_AMOUNT; j++) {
System.out.print(table[i][j] + "\t") ;
// BUT HOW TO PRINT J(COLUMN) INDEX for every column?
}
System.out.println() ;
}
}
I'm sure this will be useful for all who need to print out the result of their 2-nested loops
