Computer Science, asked by dhanwanimukesh0000, 8 months ago

find value of k if x =5 in k=++x-x+++--x in Java ​

Attachments:

Answers

Answered by ayushi7856
0

Answer:

What is the answer of x=++x++--x, if x=5

Well the Answer will be 1.

How?

First is x=++x+++--x

Now since it is having a pre increment of x first then it will increase x from 5 to 6 and assign 6 as the value for sum. And then comes - - xit is also a pre increment operator so it will also increase y from 4 to 5 and then will assign 5 for the sum .

Now the equation becomes

X=6-5

Therefore

X=1

Hope you got it.

HAPPY coding.

Similar questions