मराठी

Evaluate the following expression as per Java priority and associativity. 49 − 28 − 4 * 3

Advertisements
Advertisements

प्रश्न

Evaluate the following expression as per Java priority & associativity.

49  − 28 − 4 * 3

मूल्यांकन
Advertisements

उत्तर

Priority (Precedence): Multiplication (*) has higher precedence than subtraction (−), so it is evaluated first.

  • 4 * 3: Multiplies first, giving 12. The expression becomes 49 − 28 − 12.
  • 49 − 28: Subtraction operators share equal precedence and evaluate from left to right. This gives 21.
  • 21 − 12: Subtraction is complete, giving a final answer of 9.
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 1: Revision of Class 9 Syllabus - Exercises [पृष्ठ ४५]

APPEARS IN

रूपा पंडित Computer Applications [English] Class 10 ICSE
पाठ 1 Revision of Class 9 Syllabus
Exercises | Q 4. (iii) | पृष्ठ ४५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×