Home » JAVA Programming » Loop Control » Question
  1. What is the output of this program?

    public class Result
    {
    public static void main(String args[])
    {
    int p = 10;
    int q = 20;
    first:
    {
    second:
    {
    third:
    {
    if (p == q >> 4)
    break second;
    }
    System.out.println(p);
    }
    System.out.println(q);
    }
    }
    }
    1. 10
      20
    2. 20
      10
    3. 20
      30
    4. 10
      10
    5. 20
      20
Correct Option: A

Ans: 10
20



Your comments will be displayed only after manual approval.