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
| Way | First | Then | Answer |
|---|---|---|---|
| Left to right | 1 + 2 is 3 | 3 × 3 | 9 |
| Times first | 2 × 3 is 6 | 1 + 6 | 7 |
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 sum | What goes first | Answer |
|---|---|---|
| 1 + 2 × 3 | 2 × 3 | 7 |
| (1 + 2) × 3 | 1 + 2 | 9 |
Run it
Press Run, and read the log.
Try some more
Change the sums in the script. Predict each answer on paper, then press Run.
| The sum | Your prediction |
|---|---|
10 - 2 * 3 | ? |
(10 - 2) * 3 | ? |
4 + 6 / 2 | ? |
(4 + 6) / 2 | ? |
This section ticks itself when you press Run.

