+ 3
What is the true OUTPUT of this code?
According to the C compiler of sololearn app , the answer is 22. when i try this code in another app, i had a answer is 21. which one is the correct one? Is this depend on the compiler? https://code.sololearn.com/cW4mQ0W12HAd/?ref=app
1 Respuesta
+ 2
that is an example of undefined behavior, where the program run in unpredictable way.
for example in you case
++i + ++i + ++i
we dont know when ++i is being executed for the first time.
its all based on compiler implementation on how to handle this (cmiiw) so the result might be different on different compiler