हिंदी

Given: String st = (a>= 90)? "Excellent": "Best"; Predict the output, when a = 90. - Computer Applications

Advertisements
Advertisements

प्रश्न

Given: String st = (a>= 90)? "Excellent": "Best";

Predict the output, when a = 90.

विकल्प

  • Best

  • Excellent: Best

  • Best: Excellent

  • Excellent

MCQ

उत्तर

Excellent

Explanation:

Since condition (a>= 90) of the ternary operator is true, st is assigned the value of expression 1, i.e., excellent. 

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.04: Operators in Java - EXERCISES [पृष्ठ ४३]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×