4 ms·
The statement is valid C#, which has left-to-right execution order and no undefined behavior. The answer is 5 + 7 = 12.
by Timwi 5mo ago
The statement is valid C#, which has left-to-right execution order and no undefined behavior. The answer is 5 + 7 = 12.
- chasil 5mo agoAwk also says it's 12. awk 'BEGIN{a=5; a = a++ + ++a; print a}' 12
- kencausey 5mo agohttps://www.gnu.org/software/gawk/manual/gawk.html#index-precedence https://www.gnu.org/software/gawk/manual/gawk.html#index-pre... "When side effects happen is implementation-defined. In other words, it is up to the particular version of awk."
- chasil 5mo agoAndroid appears to use the One True AWK. :/ $ awk 'BEGIN{a=5; a = a++ + ++a; print a}' 12 :/ $ which awk /system/bin/awk :/ $ awk --version awk version 20240728