Sum of numbers from A to B
JavaScript
Easy
loops
Task «Sum of numbers from A to B»
Write a program that takes two integers A and B and uses a loop to calculate the sum of all integers from A to B inclusive. It is guaranteed that A ≤ B.
Input Format
Two integers A and B, each on a separate line.
Output Format
One integer — the sum of numbers from A to B.
Examples
Example 1
INPUT
1
10
OUTPUT
55
Example 2
INPUT
1
100
OUTPUT
5050
main.js