3 votes 3 votes #include<stdio.h> int main() { int a=-1; int c = ++a + a++ + --a; printf("%d ",c); } Programming in C programming-in-c + – nish kim asked Sep 3, 2017 nish kim 446 views answer comment Share Follow See 1 comment See all 1 1 comment reply Habibkhan commented Sep 3, 2017 reply Follow Share It will show undefined behaviour as a is being updated 3 times..So the final result will depend upon which updation takes place first for a given binary operator '+'.. 2 votes 2 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes i think it would help u.... The C standard states: "Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression. Furthermore, the prior value shall be accessed only to determine the value to be stored." To do otherwise results in undefined behavior: Anything can happen. https://www.quora.com/What-does-an-expression-involving-multiple-post-pre-decrement-increment-operators-evaluate-to-in-C-and-C++ hs_yadav answered Sep 4, 2017 selected Sep 4, 2017 by Habibkhan hs_yadav comment Share Follow See all 0 reply Please log in or register to add a comment.
–1 votes –1 votes anwer is 1 ameen babu answered Sep 4, 2017 ameen babu comment Share Follow See 1 comment See all 1 1 comment reply papesh commented Sep 4, 2017 reply Follow Share Output undefined behavior 0 votes 0 votes Please log in or register to add a comment.