contestada

The program will take two integers from the user, say n1 and n2. It will then call the method sum(n1, n2) to calculate the sum of all numbers between n1 and n2, inclusive. The answer returned by the sum( ) method will then be displayed on the screen. For example, if the user enters 5 and 9, the program will print the value of 5+6+7+8+9. On the other hand, if the user enters 5 and -2, the program will print the value of 5+4+3+2+1+0+(-1)+(-2). Note: Do not assume the user will always enter the smaller number first.