Advertisements
Advertisements
Question
Predict the output:
int m = 3, n = 5, p = 4;
if (m == n) && (n != p)
{
System.out.println(m * n);
System.out.println(n % p);
}
if ((m != n) || (n == p))
{
System.out.printIn(m + n);
System.out.println(m − n);
Answer in Brief
Solution
8
−2
shaalaa.com
Is there an error in this question or solution?
Chapter 1.08: Conditional Statements in Java - EXERCISES [Page 99]