void fill2DArray ( int x[][NUMCOLS], int nrows ) { int r, c, count=0; for ( r=0; r<nrows; r++ ) for ( c=0; c<NUMCOLS; c++ ) x[r][c] = count++ ; }