Computer Science, asked by JBJ919, 3 months ago

Q2.Give the resultant of the following expression where a=1 b=2 c=3

i. c=++a- ++b+c

ii. c=++a- ++b*c

iii. a+=++a-b++


from Java

Answers

Answered by anindyaadhikari13
3

Question:-

Give the output of the following expression.

Solution:-

Given, a=1,b=2,c=3

Question 1.

c = ++a - ++b + c

>> c = 2 - 3 +3

>> c = 2

Hence, the value of c is 2.

Question 2.

c = ++a - ++b * c

>> c = 2 - 3 * 3

>> c = 2 - 9

>> c = 7

Hence, the value of c is 7.

Question 3.

a+= ++a+ - b++

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

>> a = 1 + 2 - 2

>> a = 1

Hence, the value of a is 1.

Similar questions