English

Predict the output: int m = 3, n = 5, p = 4; if (m == n) andand (n != p) { System.out.println(m * n); System.out.println(n % p); } if ((m != n) || (n == p)) { System.out.printIn(m + n); - Computer Applications

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]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.08 Conditional Statements in Java
EXERCISES | Q III. 1. | Page 99
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×