top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to AND two numbers without using & operator, all other bitwise operators are allowed.

+1 vote
424 views
How to AND two numbers without using & operator, all other bitwise operators are allowed.
posted Feb 26, 2016 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+3 votes

Please execute the following statement in code:
unsigned num1, num2 , result;

result = ~(num1 ^ num2);

this statement will result expected output.

answer Feb 26, 2016 by Harshita
if num1 =2, num2 =2

how this works??
...