Q. What will be the output of the following Java program?

Code:
class rightshift_operator 
{
    public static void main(String args[]) 
    {    
         int x; 
         x = 10;
         x = x >> 1;
         System.out.println(x);
    } 
}
  • (A) 10
  • (B) 5
  • (C) 2
  • (D) 20
πŸ’¬ Discuss
βœ… Correct Answer: (B) 5

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
148
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Vikash Gupta
Publisher
πŸ“ˆ
88%
Success Rate