C Program To Check whether Matrix is Skew Symmetric or not | Python 3 program to check whether given matrix is skew - symmetric or not ; Utility function to create transpose matrix ; Utility function to check skew - symmetric matrix condition ; Utility function to print a matrix ; Driver program to test above functions ; Function create transpose matrix ; Check whether matrix is skew - symmetric or not
ROW = 3 NEW_LINE COL = 3 NEW_LINE def transpose ( transpose_matrix , matrix ) : NEW_LINE INDENT for i in range ( ROW ) : NEW_LINE INDENT for j in range ( COL ) : NEW_LINE INDENT transpose_matrix [ j ] [ i ] = matrix [ i ] [ j ] NEW_LINE DEDENT DEDENT DEDENT def check ( transpose_matrix , matrix ) : NEW_LINE INDENT for i in range ( ROW ) : NEW_LINE INDENT for j in range ( COL ) : NEW_LINE INDENT if ( matrix [ i ] [ j ] != - transpose_matrix [ i ] [ j ] ) : NEW_LINE INDENT return False NEW_LINE DEDENT DEDENT DEDENT return True NEW_LINE DEDENT def printMatrix ( matrix ) : NEW_LINE INDENT for i in range ( ROW ) : NEW_LINE INDENT for j in range ( COL ) : NEW_LINE INDENT print ( matrix [ i ] [ j ] , " ▁ " , end = " " ) NEW_LINE DEDENT print ( ) NEW_LINE DEDENT DEDENT matrix = [ [ 0 , 5 , - 4 ] , [ - 5 , 0 , 1 ] , [ 4 , - 1 , 0 ] , ] NEW_LINE transpose_matrix = [ [ 0 for i in range ( 3 ) ] for j in range ( 3 ) ] NEW_LINE transpose ( transpose_matrix , matrix ) NEW_LINE print ( " Transpose ▁ matrix : " ) NEW_LINE printMatrix ( transpose_matrix ) NEW_LINE if ( check ( transpose_matrix , matrix ) ) : NEW_LINE INDENT print ( " Skew ▁ Symmetric ▁ Matrix " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Not ▁ Skew ▁ Symmetric ▁ Matrix " ) NEW_LINE DEDENT