Sparkwise Try it free

Math Fun โ€บ Coding quests

Math Fun

Coding quests math problems for kids

Byte the robot pup follows your code across Pixel Park: loops, grids, bugs and secret patterns. Free story problems for Kindergarten to Grade 12, with answers, from Sparkwise.

Free forever ยท No ads ยท No tracking ยท No sign-up needed to start

Coding quests math problems for Kโ€“2

  1. Byte the robot pup follows code: step forward 1 times, then step forward 1 more times. How many steps does Byte take?

    Show the answer

    Answer: 2 steps

    1 + 1 = 2.

  2. Byte's code says: clap 2 times, and do it two times. How many claps does Byte make in all?

    Show the answer

    Answer: 4 claps

    2 + 2 = 4.

  3. Rohan finds 7 bugs in a game. 3 of the bugs get fixed. How many bugs are left?

    Show the answer

    Answer: 4 bugs

    7 โˆ’ 3 = 4.

  4. A coding game has 6 blocks of code. Each block has ten lines. How many lines is that?

    Show the answer

    Answer: 60 lines

    6 tens make 60.

  5. Byte the robot pup follows code: step forward 6 times, then step forward 4 more times. How many steps does Byte take?

    Show the answer

    Answer: 10 steps

    6 + 4 = 10.

Practise these on Sparkwise

Coding quests math problems for Grades 3โ€“5

  1. Byte's code says: repeat 4 times, move 6 steps. How many steps does Byte move in all?

    Show the answer

    Answer: 24 steps

    4 ร— 6 = 24 steps.

  2. Byte walks on a grid from the start to a treasure square: 3 squares to the right and 2 squares up. Then he walks the same way back. How many squares does Byte walk in all?

    Show the answer

    Answer: 10 squares

    2 ร— (3 + 2) = 10 squares.

  3. A game has 1,411 lines of code. The coders delete 365 lines and add 704 new lines. How many lines does the game have now?

    Show the answer

    Answer: 1,750 lines

    1,411 โˆ’ 365 + 704 = 1,750 lines.

  4. 35 lines of code are shared equally among 5 coders. How many lines does each coder write?

    Show the answer

    Answer: 7 lines

    35 รท 5 = 7.

  5. Byte's code says: repeat 9 times, move 9 steps. How many steps does Byte move in all?

    Show the answer

    Answer: 81 steps

    9 ร— 9 = 81 steps.

Practise these on Sparkwise

Coding quests math problems for Grades 6โ€“8

  1. A panel has 5 switches, and each switch can be on or off. How many different on/off patterns can the panel show?

    Show the answer

    Answer: 32 patterns

    2^5 = 32 patterns.

  2. A game works out the score with: score = 2 ร— coins + 8. Byte collects 7 coins. What is his score?

    Show the answer

    Answer: 22 points

    2 ร— 7 + 8 = 22.

  3. Byte's counter starts at 12 and adds 5 each time the loop runs. After some runs it shows 32. How many times did the loop run?

    Show the answer

    Answer: 4 runs

    32 โˆ’ 12 = 20, and 20 รท 5 = 4 runs.

  4. A pixel picture has 180 pixels, and 20% of them are lit. How many pixels are lit?

    Show the answer

    Answer: 36 pixels

    20% of 180 = 36.

  5. A panel has 8 switches, and each switch can be on or off. How many different on/off patterns can the panel show?

    Show the answer

    Answer: 256 patterns

    2^8 = 256 patterns.

Practise these on Sparkwise

Coding quests math problems for Grades 9โ€“12

  1. A program makes a copy of its data every second, so the amount doubles each second. It starts with 5 megabytes. How many megabytes are there after 2 seconds?

    Show the answer

    Answer: 20 megabytes

    5 ร— 2^2 = 5 ร— 4 = 20 megabytes.

  2. A school coding club uses a passcode made of 3 letters. Each letter can be any of the 26 letters of the alphabet, and letters can repeat. How many different passcodes are possible?

    Show the answer

    Answer: 17,576 passcodes

    26^3 = 17,576 passcodes.

  3. In testing, a new level crashed on 24 of 30 test runs. What is the experimental probability that the next run crashes? Give a decimal rounded to 2 places.

    Show the answer

    Answer: 0.8

    24 รท 30 โ‰ˆ 0.8.

  4. A program takes 0.4 seconds to start and then 0.02 seconds for each item it sorts: time = 0.4 + 0.02n seconds. How long does it take to sort 600 items, in seconds?

    Show the answer

    Answer: 12.4 seconds

    0.4 + 0.02 ร— 600 = 12.4 seconds.

  5. A program makes a copy of its data every second, so the amount doubles each second. It starts with 12 megabytes. How many megabytes are there after 4 seconds?

    Show the answer

    Answer: 192 megabytes

    12 ร— 2^4 = 12 ร— 16 = 192 megabytes.

Practise these on Sparkwise

Want more Coding quests problems?

Sparkwise makes a fresh set every time, at the right level, with hints when you get stuck. The math is the same as school.

Practise Coding quests math, free

More things kids love