+ 1
what is the true output of this code??
there is a problem with the output of some codes. actually it can be depend on C compiler. Eg: according to the C compiler of sololearn app, this tagged code's output is 22. but when you try it another app u can have a answer is 21. it is also a possible answer https://code.sololearn.com/cW4mQ0W12HAd/?ref=app
1 Resposta
+ 2
This is known as undefined behaviour. This thing can be seen in C++ too! Think of BODMAS rule. Ecery language implement mathematical expressions according to it. But in C languages there is no common way of executing increments or decrements. So different C/C++ compilers execute those instructions differently. In fact all of them are right.
Therefore it is recommended not to modify the value of a variable in a single statement because the value of that variable is truly undefined.