title: Can XOR of two integers go out of bounds?
body: <p>I had been studying the algorithm for finding lonely integers in an array, and here is the implementation:</p>
  
  <pre><code>int arr[] = {10, 20, 30, 5, 20, 10, 30};
  int LonelyInteger = 0;
  for(int i=0; i&lt; 7; i++)
  {
      LonelyInteger = LonelyInteger ^ arr[i];
  }
  </code></pre>
  
  <p>The result is <code>5</code>.</p>
  
  <p>My question is - supposedly the integers (getting generated by the <code>XOR</code> operation) are <strong>too large</strong> due to this operation:</p>
  
  <pre><code>LonelyInteger ^ arr[i]
  </code></pre>
  
  <p>Which leads to a potentially large integer which cannot be represented by the datatype say <code>int</code> in this case. My questions are:</p>
  
  <ol>
  <li>Is it even possible that <code>XOR</code> will generate such a large integer value that cannot be stored in the <code>int</code> type?</li>
  <li>If it is not possible that this can happen then is there a proof for this?</li>
  </ol>