title: Compare two binary numbers and get the different bits
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/109023/best-algorithm-to-count-the-number-of-set-bits-in-a-32-bit-integer">Best algorithm to count the number of set bits in a 32-bit integer?</a>  </p>
  </blockquote>
  
  
  
  <p>I want to write a program to get the number of 1's bit in comparing two numbers.if I compare the bits between any two numbers
  to find where the binary numbers are different in the 1's and 0's.
  in other words Exclusive OR (XOR) relationship.</p>
  
  <p>like if 22 (which has 10110 binary)and compare it with 15 (which has 01111 binary)</p>
  
  <p>the first one 10110</p>
  
  <p>the second one 01111</p>
  
  <p>the result 11001</p>
  
  <p>and the answer would be 25 but what I want to get is 3 where there is three 1's and 0's that are different. </p>