हिंदी

Use if else statement for the given snippet: String st = (a > 0) ? (a % 2 == 0) ? "Positive even" : "Positive odd" : "Negative number"; - Computer Applications

Advertisements
Advertisements

प्रश्न

Use if else statement for the given snippet:

String st = (a > 0) ? (a % 2 == 0) ? "Positive even" : "Positive odd" : "Negative number"; 
संक्षेप में उत्तर

उत्तर

String st; int a; 
if (a > 0) 
{
if (a % 2 == 0) 
st = "Positive Even"; 
else 
st = "Positive Odd"; 
else 
st = "Negative Number"; 
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.08: Conditional Statements in Java - Review Insight [पृष्ठ ९७]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.08 Conditional Statements in Java
Review Insight | Q 4. | पृष्ठ ९७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×