Implement an algorithm which increases number
and returns the result. Start from number
and increment by step
as many times as iterations
demands.
Input: number
, iterations
, step
.
Example:
alg(2, 5, 10) => 2 + 10 + 10 + 10 + 10 + 10 = 52
alg(17, 3, 6) => 17 + 6 + 6 + 6 = 35
Tests:
alg(100, 5, 50)
alg(14, 20, 4)
Good luck!
Want to propose a challenge idea for a future post? Email yo+challenge@dev.to with your suggestions!