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

    public class operators
    {
    public static void main(String args[])
    {
    int p = 10;
    System.out.println(++p * 5 + " " + p);
    }
    }
    1. 44 11
    2. 33 11
    3. 55 11
    4. 66 11
    5. 11 55
Correct Option: C

Operator ++ has higher precedence than multiplication operator, *, p is incremented to 11 than multiplied with 5 giving 55.
output: 55



Your comments will be displayed only after manual approval.