Advertisements
Advertisements
प्रश्न
Evaluate the following expression as per Java priority & associativity.
52 * 7 % 7
मूल्यांकन
Advertisements
उत्तर
Priority (Precedence): Both multiplication (*) and modulo have the same precedence level in Java.
Associativity: Because their precedence is equal, Java evaluates them from left to right.
- 52 * 7: Evaluates first, giving 364.
- 364 % 7: Divides 364 by 7. Since 364 is exactly divisible by 7 7 × 52 = 364, the remainder is 0.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1: Revision of Class 9 Syllabus - Exercises [पृष्ठ ४५]
