What is the value of y after evaluating the expression given below? y+= ++y + y-- + --y; when int y=8;
Advertisements
प्रश्न
What is the value of y after evaluating the expression given below?
y+= ++y + y-- + --y; when int y=8;
थोडक्यात उत्तर
Advertisements
उत्तर
33
Working:
y+= ++y + y-- + --y;
y = y + (++y + y-- + --y)
= 8 + (9 + 9 +7)
= 8 + 25
= 33
shaalaa.com
Introduction of Values and Data Types
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 1.04: Operators in Java - EXERCISES [पृष्ठ ४४]
