For my intro programming class, this assignment requests the use of a while loop. The objective is to input 2 integers (firstNum, secondNum), verify the first value is smaller than the second, and then output the odd integers between the two input values
(inlcuding the input if it is odd). After outputting those, it wants us to output the sum of even integers between (and including if input was even) the inputs.
The formatting guide that came with our assignment uses
test variables 5 and 21, so I have been testing my program with the same values. The odd numbers populate perfectly. The issue I'm running into is that when it's time to add the sum of the integers the value is not correct. If I enter even values 6 & 20 I get a sum of 91, and if I enter 5 and 21 I get a value of 118, neither of which are the correct value (104, which they should both be.) This is what I have for my program right now. I'm really not sure where to go/what to do to rectify this issue.
Edit: Editing to mention the Sqr variables above are for a second part of the program I have not written yet, but are irrelevant to this loop. (it is in a second whileloop).