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 [पृष्ठ ४५]
