What is the output after compile and run the following code ?

Loading

Choose the correct option.

What is the output after compile and run the following code ?

int Output = 10;
boolean b = false;
if((b == true) && ((Output += 10) == 20))
{
System.out.println(“We are equal ” + Output);
}
else
{
System.out.println(“Not equal! ” + Output);
}

A. Compilation and output of “We are equal 10”
B. Compilation error, attempting to perform binary comparison on logical data type
C. Compilation and output of “Not equal! 10”
D. Compilation and output of “Not equal! 20”

Leave a Comment