I guess your code is this:
Int RangeSum(int start, int end) {
Int i, sum=0;
for (i=0; I<10; I++) {
If (i%2!=0) {
Sum=sum+i;
}
}
Return sum;
}
You want the sum of odds between
start
and
end
.
The problem is that you don't use those variables in the for loop.
Your for loop goes from 0 to 10, and you want the loop to go from
start
to
end
.
Solution should be rather easy.