java bitwise and two integers code example
Example: add two numbers bitwise
public class Bitwise_Addition{
int add(int a, int b){
int c;
while(b!=0){
c=a&b;
a=a^b;
b=c<<1;
}
return a;
}
}
public class Bitwise_Addition{
int add(int a, int b){
int c;
while(b!=0){
c=a&b;
a=a^b;
b=c<<1;
}
return a;
}
}