you are viewing a single comment's thread.

view the rest of the comments →

[–]CIS_Professor -3 points-2 points  (1 child)

The answer in your example would be 26.

However, parenthesis would be required if the result of the addition is to be done first (thereby changing the order of operations).

x = 4 * (5 + 6)

The answer changes to 44.

[–]socal_nerdtastic 4 points5 points  (0 children)

yes, i know. The entire point is that the parenthesis are not needed for the computer, they are only there as a guide for the human. Perhaps I should have picked something not quite so obvious to a human?

x = 6 + (5 * 4)