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.
- Write a
forloop that initializing a variableiatstartValue. - The loop runs as long as
iis less than or equal tolimit. - The step expression should increase
ibystrideeach time. - Print the value of
iinside the loop.
01EXAMPLE 1
Input
start=10, limit=20Output
10
13
16
19Explanation: Starts at 10, jumps by 3.
02EXAMPLE 2
Input
start=1, limit=10Output
1
4
7
10Explanation: Starts at 1, jumps by 3 until 10.
Constraints
- Use a for loop.
- The loop must increment exactly by 3.
LoopsFundamentals
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
startValue10
limit20
stride3
Expected Output
10 13 16 19
Click RUN to test your solution