KnowledgeBoat Logo

Computer Applications

A Java statement is given as:
if((a!=b)&&(a==c))

Which of the following statements is true?

  1. b is the smallest number
  2. b is the greatest number
  3. a is the smallest number
  4. Both (a) and (b)

Input in Java

15 Likes

Answer

Both (a) and (b)

Reason — The if condition checks that a and b are unequal and a and c are equal. Both these conditions should be true then only if statement will execute. If a and b are unequal and a and c are equal then b will either be the smallest number or the greatest number.

Answered By

6 Likes


Related Questions