a1 = ++ a – a++ + -- a if a = 5
Answers
Answered by
2
Required Answer:-
Given:
- a = 5
- a1 = ++a – a++ + --a
To Find:
- The value of a1. (Java)
Solution:
Given that,
>> a = 5
Now,
>> a1 = ++a – a++ + --a
>> a1 = 6 – a++ + --a (a becomes 6, pre-increment)
>> a1 = 6 – 6 + --a (a is 6, post-increment)
>> a1 = 6 – 6 + --a (a becomes 7)
>> a1 = 6 - 6 + 6 (a becomes 6, pre-increment)
>> a1 = 0 + 6
>> a1 = 6
Therefore,
>> a1 = 6 and a = 6
Answer:
- a1 = a = 6
Similar questions
Social Sciences,
1 month ago
Social Sciences,
1 month ago
Social Sciences,
3 months ago
Science,
3 months ago
Math,
10 months ago
Math,
10 months ago