Performing elementary operations
for ( i = 0 ; i < n ; i ++ ) { if ( a [ i , i ] == 0 ) { c = 1 ; while ( ( i + c ) < n && a [ i + c , i ] == 0 ) c ++ ; if ( ( i + c ) == n ) { flag = 1 ; break ; } for ( j = i , k = 0 ; k <= n ; k ++ ) { float temp = a [ j , k ] ; a [ j , k ] = a [ j + c , k ] ; a [ j + c , k ] = temp ; } } for ( j = 0 ; j < n ; j ++ ) {