Which sum goes first?

Try itKeeping count

Here is a sum with a surprise in it.

1 + 2 × 3

What is the answer? Write it down before you read on.

Two ways to do it

WayFirstThenAnswer
Left to right1 + 2 is 33 × 39
Times first2 × 3 is 61 + 67

Two answers! That would be a disaster in a game. So everyone agreed on one rule, long ago.

The rule

Times and divide go first. Then plus and minus.

So 1 + 2 × 3 is 7. Scripts follow the same rule.

Brackets change the order

If you want the plus done first, put brackets round it. The part in brackets always goes first.

The sumWhat goes firstAnswer
1 + 2 × 32 × 37
(1 + 2) × 31 + 29

Run it

Press Run, and read the log.

No problems detected

Try some more

Change the sums in the script. Predict each answer on paper, then press Run.

The sumYour prediction
10 - 2 * 3?
(10 - 2) * 3?
4 + 6 / 2?
(4 + 6) / 2?

This section ticks itself when you press Run.

Press Play in the code box to finish this section.