The Triple Leap

EasyAcc. 98.1%
+15 XP 5

The Giant's Stride

You don't have to walk one step at a time. The third expression in a for loop controls the "stride." You can leap over numbers by increasing the counter by a larger amount in each cycle.

The Assignment

Your function receives parameters startValue, limit, and stride.

  1. Write a for loop that initializing a variable i at startValue.
  2. The loop runs as long as i is less than or equal to limit.
  3. The step expression should increase i by stride each time.
  4. Print the value of i inside the loop.

01EXAMPLE 1

Inputstart=10, limit=20
Output10 13 16 19

Explanation: Starts at 10, jumps by 3.

02EXAMPLE 2

Inputstart=1, limit=10
Output1 4 7 10

Explanation: Starts at 1, jumps by 3 until 10.

Constraints

  • Use a for loop.
  • The loop must increment exactly by 3.
LoopsFundamentals
JavaScript
Loading...
3 Hidden

Input Arguments

startValue10
limit20
stride3

Expected Output

10
13
16
19

Click RUN to test your solution