Home » JAVA Programming » Basic Operators » Question
  1. What is the output of this program?

    public class RightShift_Operator
    {
    public static void main(String args[])
    {
    int a;
    a = 100;
    a = a >> 1;
    System.out.println(a);
    }
    }
    1. 10
    2. 20
    3. 30
    4. 40
    5. 50
Correct Option: E

Right shift operator, >>, devides the value by 2.
output: 50



Your comments will be displayed only after manual approval.