English

Give the output of the following expression:a+= a++ + ++a + -- a + a--; when a = 7; - Computer Applications

Advertisements
Advertisements

Question

Give the output of the following expression:
a+= a++ + ++a + -- a + a--; when a = 7;

Answer in Brief
Short Note

Solution

39

Working:

a+= a++ + ++a + --a + a--;

a = a + (a++ + ++a + --a + a--)

= 7 + (7 + 9 + 8 + 8)

= 7 + (32)

= 39

shaalaa.com
Introduction of Object-oriented Programming
  Is there an error in this question or solution?
Chapter 1.04: Operators in Java - EXERCISES [Page 44]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.04 Operators in Java
EXERCISES | Q V. 6. (c) | Page 44
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×