Find XOR of two number without using XOR operator | C # program to find XOR without using ^ ; Returns XOR of x and y ; Driver Code
using System ; class GFG { static int myXOR ( int x , int y ) { return ( x y ) & ( ~ x ~ y ) ; } static public void Main ( ) { int x = 3 , y = 5 ; Console . WriteLine ( " XOR ▁ is ▁ " + ( myXOR ( x , y ) ) ) ; } }