हिंदी

Rewrite the following program segment using if-else statements instead of the ternary operator. c = (x >= 'A' andand x <= 'Z') ? "Upper Case Letter" : "Lower Case Letter"; - Computer Applications

Advertisements
Advertisements

प्रश्न

Rewrite the following program segment using if-else statements instead of the ternary operator.

c = (x >= 'A' && x <= 'Z') ? "Upper Case Letter" : "Lower Case Letter";

संक्षेप में उत्तर

उत्तर

String c;
if (x >= 'A' && x <= 'Z')
c = "Upper Case Letter";
else
c = "Lower Case Letter";
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.04: Operators in Java - EXERCISES [पृष्ठ ४४]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.04 Operators in Java
EXERCISES | Q V. 7. (e) | पृष्ठ ४४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×