Utility function to create transpose matrix
void transpose ( int transpose_matrix [ ROW ] [ COL ] , int matrix [ ROW ] [ COL ] ) { for ( int i = 0 ; i < ROW ; i ++ ) for ( int j = 0 ; j < COL ; j ++ ) transpose_matrix [ j ] [ i ] = matrix [ i ] [ j ] ; }