Computer Applications
If m, n, p are the three integers, then which of the following holds true, if (m == n) && (n != p)?
- 'm' and 'n' are equal
- 'n' and 'p' are equal
- 'm' and 'p' are equal
- none
Java Conditional Stmts
38 Likes
Answer
'm' and 'n' are equal
Reason — Assuming that the && operator results in 'true', we can conclude that both the conditions (m == n) and (n != p) are true. Hence, m and n are equal.
Answered By
29 Likes
Related Questions
A compound statement can be stated as:
- p = in.nextInt();
q = in.nextInt(); - m =+ + a;
n =— b; - if(a > b)
{ a++; b--;} - none
- p = in.nextInt();
If((p>q) && (q>r)) then
- q is the smallest number
- q is the greatest number
- p is the greatest number
- none
if(a<b)
c = a;
else
c = b;
It can be written as:- c = (b<a) ? a:b;
- c = (a!=b) ? a:b;
- c = (a<b) ? b:a;
- none
If(a < b && a < c)
- a is the greatest number
- a is the smallest number
- b is the greatest number
- none (where a, b and c are three integer numbers)