I need to write program that asks a user for two numbers and then computes and outputs the sum of all of the consecutive numbers between the two numbers. Like if the user were to enter numbers 45 and 51, the program would compute (45 + 46 + 47 + 48 + 49 + 50 + 51) then output the result to the screen. Assume that the first number will always be less than the second number.
The program can contain either a for or a while. Loop but it is basically personal preference as to which one to use.
I am having trouble writing this program, I know that it is simple. But any help setting it up would be greatly appreciated!