हिंदी

Evaluate the following expression as per Java priority and associativity. 6 * 2 / 4

Advertisements
Advertisements

प्रश्न

Evaluate the following expression as per Java priority & associativity.

6 * 2 / 4

मूल्यांकन
Advertisements

उत्तर

Priority (Precedence): Both multiplication (*) and division (/) have the same precedence level in Java.

Associativity: Since their precedence is equal, Java evaluates them from left to right.

  • First, evaluate the left-most operation: 6 * 2 = 12
  • Next, evaluate the remaining operation: 12 / 4 = 3
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. (i) | पृष्ठ ४५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×