KnowledgeBoat Logo

Output Questions for Class 10 ICSE Computer Applications

Determine the output of the following program.

public class PredictOutput2
{
  public static void main(String args[])
  {
       int a = 6, b = 2, c = 3;
       System.out.println("Output 1: " + (a == b * c)); 
       System.out.println("Output 2: " + (a == (b * c)));
  }
}

Java

Java Operators

ICSE

22 Likes

Answer

Output

Output 1: true
Output 2: true

Explanation

b * c results in 6 which is equal to the value of a so true is printed in both the cases.

Answered By

12 Likes