Numbers formed by flipping common set bits in two given integers | Function to flip bits of A and B which are set in both of them ; Clear the bits of A which are set in both A and B ; Clear the bits of B which are set in both A and B ; Print updated A and B ; Driver Code
def flipBitsOfAandB ( A , B ) : NEW_LINE INDENT A = A ^ ( A & B ) NEW_LINE B = B ^ ( A & B ) NEW_LINE print ( A , B ) NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT A = 10 NEW_LINE B = 20 NEW_LINE flipBitsOfAandB ( A , B ) NEW_LINE DEDENT