The Arithmetic Check

EasyAcc. 96.2%
+15 XP 5

Constant Strides

In an Arithmetic Progression, the difference between any two consecutive terms is constant. Example: 2, 5, 8, 11 (difference is 3).

The Assignment

Your function receives parameters start, count, and diff.

  1. Use a loop to print exactly count numbers.
  2. The sequence should start at start and increase by diff each time.

01EXAMPLE 1

Inputstart=2, count=3, diff=3
Output2 5 8

Explanation: Starts at 2, adds 3 twice.

Constraints

  • Print each number on a new line.
  • Handle negative differences correctly.
MathLoops
JavaScript
Loading...
3 Hidden

Input Arguments

start2
count3
diff3

Expected Output

2
5
8

Click RUN to test your solution