English

Find errors in the following snippet: int a = 5, b = 3; if (a <= b) System.out.println(a); else System.out.println(c = a + b); - Computer Applications

Advertisements
Advertisements

Question

Find errors in the following snippet:

int a = 5, b = 3; 
if (a <= b) 
   System.out.println(a); 
else 
   System.out.println(c = a + b); 
One Line Answer

Solution

Assignment statement can't be used along with the print statement.

shaalaa.com
  Is there an error in this question or solution?
Chapter 1.08: Conditional Statements in Java - Review Insight [Page 97]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.08 Conditional Statements in Java
Review Insight | Q 5. (a) | Page 97
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×