In my code, I have to take two numbers, such as 3 and 11, find the odd numbers between them (inclusive), add the odd numbers together and print the sum. I've looked up ways to do this and all the ways I've tried have given me a different result each time.
Can anyone help me figure out what I'm doing wrong? https://repl.it/@20rduncan/035-Sum-Odds-in-Range
Sum of Odd numbers - Java
In my code, I have to take two numbers, such as 3 and 11, find the odd numbers between them (inclusive), add the odd numbers together and print the sum. I've looked up ways to do this and all the ways I've tried have given me a different result each time.
Can anyone help me figure out what I'm doing wrong?
https://repl.it/@20rduncan/035-Sum-Odds-in-Range
Ah, I see what you mean. I feel kind of stupid I couldn't figure that out.
Thanks! :)