Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
i have two number e.g, x=56=00111000 and y=50=00110010 and there are two number bits in both numbers, how i find through c# program, kindly help me.
thanks in advance.
Posted
Comments
Sergey Alexandrovich Kryukov 22-Dec-11 0:56am    
Back to school! If you are self-taught -- pay attention: bit operations is an absolute must-have skill. Not too worry, at most couple of days of light exercise having a head on your shoulders -- and you master it.
--SA

1 solution

For example, if you XOR them, that is, x ^ y, the set bits will indicate the bit positions where x and y bits are different.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900