Menu
Question Index
...

What will be the output of the following program?

class OperatorsOutput
{
    public static void main(String s[])
    {
        int a = 12 + 21 * 3 - 9 / 2;
        int b = 14 - 32 * 4 + 175 / 8 - 3;

        if(++a > 71 && --b < 20)
        {
            System.out.println("a = " + a + " b = " + b);
        }

        if(b-- == -97 || a-- < 100)
        {
            System.out.println("a = " + a + " b = " + b);
        }
    }
}


a = 72 b = -97
a = 71 b = -98
a = 72 b = -98
a = 72 b = -97
a = 72 b = -98
Compilation Error

Doubts

Problems

Topic: if Condition In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App