The commutative property + Order of operations + disambiguation results in
6 + 6 + (6 x 6 x 0)
PS C:\WINDOWS\system32> 6 + 6 + 6 * 6 * 0
12
Python, C++, Java, C# - all yield the same result.
you could sort-of ignore OOO if the equation were re-written and evaluated left to right as
6 * 6 * 0 + 6 + 6
Without understanding the commutative property, you would end up with 2 different and "correct" answers.
But the commutative declares that 6 + 6 + 6 * 6 * 0 = 6 * 6 * 0 + 6 + 6. If we didn't have that property, computer programming would not work because math wouldn't work.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.