++x + ++x + ++x in turbo C is 15 as expected ( 4 + 5 + 6)
and further more will be like this 4+5+6+7+8+9+10…
even in C# ++x + ++x is 9 in Visual Studio express
Any idea which complier among Dev C++, Turbo C is designed according to ANSI standards?
Neither, they have added lots of their own features. GCC is in accordance with the standard. I checked the answer on various compilers and got 16 as answer, but in turbo c, the answer was 15. Sorry for my wrong answer.
Yes, It is 15 in turbo c
@dragonemperor even in C# it is 15 but I am still not getting how could ++x + ++x is equal to 10? which compiler you are using?
gcc compiler
29
6 (Converted in 6 from 5) + 6 (still 6 but now converted in 7) + 8 (converted 7 to 8) + 9 (converted 8 to 9)
29 is the answer
its 30 in gcc. Try it from right->left order.
yes from right to left it is 30 (6 + 7 + 7 (converted into 8) + 10)
btw can you give me the link to download gcc (I know this is not the right place but I really need it and you are right from right to left your answer is right while in left to right order my answers are right)
just google it.
@ geeksoul Actuallly the answer is 27 on gcc. Regarding GCC go check out this link http://www.mingw.org/category/wiki/download
@sunny210 might be result in gcc is 27 but according to right to left approach 30 is correct while according to left to right approach 29 is the best answer
Its 30. I tried it on gcc before posting it. Can you explain the order of evaluation in which the answer is 27?
output be 6
u r right man…
I am happy that I could help you