The sum of integers from a to b

Report a typo

Print the sum of all integers from a to b including both.

It is guaranteed that a < b in all test cases.

Sample Input 1:

5
21

Sample Output 1:

221
Write a program in Java 17
import java.util.Scanner;

class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// start coding here
}
}
___

Create a free account to access the full topic