If x = 3 initially, what will be the result 'x' after the execution of the following statement:. x + = x + + + - - x + 4;
Answers
Answered by
11
x+=3(4) + 3 +4
x+= 10
x=3+10
x=13
Answered by
24
Here x++ is a increment postfix operator .This will change or will increase the value of x by 1 after exceution of program. Here the value of x will increase after x++.
So it will become 4.
Here --x is a prefix decrement operator. This will change or will decrease the value of x by 1 before execution of programming.
Here x+ is short hand binary operator .It can be formed only when a variable is used as an counter in the expression. The same variable is to be used both after and before the assignment sign.
So,
Shruthi123456:
Nice answer didi
Similar questions