मराठी

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×