I'm trying to write a program that outputs the odd numbers' sum between a certain range. For example, [3,9].
For example,
INPUT:
2
1
5
3
9
OUTPUT:
Case 1: 9 //(1+3+5)
Case 2: 24 //(3+5+7+9)
My code is below.
I encounter a problem that the output contains a really weird and large number which is not my wished output. Please help me correct my code. Thank you all.