What will be the value of y if x=5 y= ++x + --x + ++x
Answers
Answered by
5
Answer:
c++ or g++ compiler. It will give output as y=12.
Expression include pre and post increment operator.
x++ will be 5 (if value of x is 5) only as it prints or holds the value first than increment the value later. It is a case of pre-increment operator
++x will be 6 (if value of x is 5) as it increments the value first than prints or holds the value later. It is a case of post-increment operator
Similar questions