0 votes 0 votes #include int main() { int i = 1; printf("%d %d %d\n", i++, i++, i); return 0; } Programming in C programming-in-c + – shiva0 asked Jan 11, 2019 shiva0 655 views answer comment Share Follow See all 8 Comments See all 8 8 Comments reply Kunal Kadian commented Jan 11, 2019 reply Follow Share 2 1 1 Bcoz it is executed from right to left. First i, then i++, then i++ 1 votes 1 votes Ravi kumar singh commented Jan 11, 2019 reply Follow Share i ran this code in compiler its showing 2 1 3 how? 0 votes 0 votes Kunal Kadian commented Jan 11, 2019 reply Follow Share Actually using increment or decrement operator more than once on the same variable in the same statement may produce ambiguous result. Results will vary from compiler to compiler. 0 votes 0 votes shiva0 commented Jan 12, 2019 reply Follow Share how you got 2 ,initially " i " is initialised with 1 and you are printing " i++ " And in dev cpp compiler am getting 213 as output why??????????? diifferent compilers are producing different outputs can you explain what is the reason ??? 0 votes 0 votes shiva0 commented Jan 12, 2019 reply Follow Share is there any resources to your answer ...? 0 votes 0 votes shiva0 commented Jan 12, 2019 reply Follow Share am also getting 213 as output i don't know bro 0 votes 0 votes shiva0 commented Jan 12, 2019 reply Follow Share i got the answer please visit the link https://gateoverflow.in/145072/programming-doubt 0 votes 0 votes OneZero commented Jan 12, 2019 reply Follow Share Undefined behavior https://www.geeksforgeeks.org/execution-printf-operators/ 0 votes 0 votes Please log in or register to add a comment.