मराठी

Rewrite the following using ternary operator : if (bill > 10000) discount = bill * 10.0 / 100; else discount = bill * 5.0 / 100; - Computer Applications

Advertisements
Advertisements

प्रश्न

Rewrite the following using ternary operator : 

if (bill > 10000)
discount = bill * 10.0 / 100;
else
discount = bill * 5.0 / 100;
एका वाक्यात उत्तर

उत्तर

double discount = (bill > 1000) ? bill * 10.0 / 100 : bill * 5.0 / 100;
shaalaa.com
Introduction of Operators in Java
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 1.04: Operators in Java - EXERCISES [पृष्ठ ४४]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×