Computer Science, asked by Anonymous, 5 months ago

int a=4, b=9;
a+=++b - a++ +b
System.out.println ("a="+a)

Answers

Answered by Anonymous
6

The output will be 20.

++b=10

a++=4

+b=9

a+=++b - a++ +b can be written as

a=++b - a++ +b +a

a= 10 - 4 +9 +4

a= 23-4= 19

+a= 19+1= 20

Output:

a=20

Answered by NiyaSurve
4

If a = 5, b = 9 calculate the value of a+ = a++ – ++b +a

a + = a ++ – ++ b + a

= 5 – 10 + 6 a + = 1

The value of a after execution will be 6.

Attachments:
Similar questions