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

    public class Output
    {
    public static void main(String args[])
    {
    int p = 5;
    int q = 7;
    int r;
    int s;
    r = ++q;
    s = p++;
    r++;
    q++;
    ++p;
    System.out.println(p + " " + q + " " + r);
    }
    }
    1. 6 7 7
    2. 5 8 8
    3. 7 9 9
    4. 7 6 6
    5. 8 7 7
Correct Option: C

Output: 7 9 9



Your comments will be displayed only after manual approval.