Computer Science, asked by Anonymous, 1 month ago

can anyone please solve this question..​

Attachments:

Answers

Answered by skylog4444
0

Explanation:

initially a is set to 5 which is incremented and becomes 6

now the first 'System.out.println' prints out '6'

the line 'a-=(a--)-(--a)' can be actually simplified to 'a=a-((a--)-(--a))'

so putting the values, a=6-(6-4)=4

since 'a--' returns the value of a and then decrements it and '--a' first decrements the value of a and then returns it.

it's kinda like this, a is 6 then a-- returns 6 and changes the value of a to 5 and the second --a changes the value of a to 4 and returns it.

Hope you understood it.

Similar questions