Loops - Sum of all numbers between A and B
In the code bellow you have two numeric variables, a
and b
.
Write a loop that calculates the sum of all the numbers from a
to b
and save it to the result
variable.
Example: a = 1, b = 3; output: result === 6 because 1 + 2 + 3 is 6
Loading...
Loading...
Loading...
Loading...