98 718
Assignments Done
98.6%
Successfully Done
In April 2021

# Answer to Question #3565 in Java | JSP | JSF for Y mukundareddy

Question #3565
(3) Write a program to perform all bitwise operators on the following variables a=50, b=20?
1
2017-01-20T09:13:45-0500
public class Bitwise {

static int a = 50;
static int b = 20;

public static void main(String[ ] args) {
int c = a^b;
System.out.println("a ^ b =" +c);
c = a&b;
System.out.println("a & b =" +c);
c = a|b;
System.out.println("a | b =" +c);
c = a^b;
System.out.println("a ^ b =" +c);
a&=b;
System.out.println("a &= b =" +a);
a = 50;
a^=b;
System.out.println("a ^= b =" +a);
a = 50;
a|=b;
System.out.println("a |= b =" +a);
a = 50;
c = a<<b;
System.out.println("a << b =" +c);
c = a>>b;
System.out.println("a >> b =" +c);
c = a>>>b;
System.out.println("a >>> b =" +c);
a<<=b;
System.out.println("a <<= b =" +a);
a = 50;
a>>=b;
System.out.println("a >>= b =" +a);
a = 50;
a>>>=b;
System.out.println("a >>>= b =" +a);
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!