Hi guys,
I want to find the sum of numbers(inclusive) between TWO integers inputted by user.
Example: if user enters 1 and 4, then it outputs: Sum = 10
I just started my code:
public static void main(String[] args) {
int number1 = 0,number2 = 0,Sum = 0;
Scanner input = new Scanner(System.in);
System.out.print("first integer:");
number1 = input.nextInt();
System.out.print("second integer:");
number2 = input.nextInt();
}
How can I do it? Do I have to use loops?