Menu
Question Index
...

What will be the output of the following program?

public class checking
{
    public static void main(String s[])
    {
        int c = 0, e = 50;
        boolean b = (c == 1) || (++e < 100);
        System.out.println("e = " + e);
        boolean f = (e++ < 100) || (c == 1);
        System.out.println("e = " + e);
    }
}


e = 50
e = 50
e = 50
e = 51
e = 51
e = 51
e = 51
e = 52
Compilation Error or Runtime Error

Doubts

Problems

Topic: Short Circuit Logical Operators 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