Detect when exactly one of A,B is equal to five. return (A==5) ^^ (B==5) ... The != operator serves this purpose for bool values. ... For a true logical XOR operation, this ...
stackoverflow.com