Java Right Shift Operator Example


Program
public class RightShiftOperatorExample{ public static void main(String args[]){ System.out.println(20>>2);//20/2^2=20/4=5 System.out.println(20>>3);//20/2^3=20/8=2 System.out.println(30>>2);//30/2^2=30/4=7 }}
Input
Output

Similar Program

# Program Language
1 Java
2 Java
3 Java
4 Java
5 Java
6 Java
7 Java
8 Java
9 Java
10 Java
11 Java
12 Java
13 Java
14 Java
15 Java
16 Java
17 Java
18 Java
19 Java
20 Java
# Program Language