title: Working of bitwise XOR on int operands of arrays
body: <p>I am just a beginner.So, the problem that I am facing is :-</p>
  
  <p>How does the logic of bitwise XOR works in case of arrays? </p>
  
  <p>For example in the code below:-</p>
  
  <pre><code>// Function to return the only odd occurring element
  int findOdd(int arr[], int n) {
     int res = 0, i;
     for (i = 0; i &lt; n; i++)
       res ^= arr[i];
     return res;
  }
  
  int main(void) {
     int arr[] = {12, 12, 14, 90, 14, 14, 14};
     int n = sizeof(arr)/sizeof(arr[0]);
     printf ("The odd occurring element is %d ", findOdd(arr, n));
     return 0;
  }
  </code></pre>
  
  <p>How, exactly, is the whole findOdd function working?
  Can someone please explain the basic logic behind the use of xor in the above code example?</p>