Computer Applications
A Java statement is given as:
if((a!=b)&&(a==c))
Which of the following statements is true?
- b is the smallest number
- b is the greatest number
- a is the smallest number
- 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
Which of the following operators is essentially required while writing if statement?
- Arithmetic
- Relational
- Bitwise
- All of them
Due to which of the following errors, a program does not provide correct result although it has no grammatical mistake?
- Logical
- Syntax
- Type mismatch
- None of the above
Which of the following logical operators results in true when all the connecting conditions are true?
- !
- ||
- &&
- !=
State whether the following statement is True or False :
Java programs can be compiled and executed on BlueJ platform.