Quote:Original post by aaroncox_123
I'm trying to create a function that will return false if the argument passed to it is false.
You mean if the arguement is even? There are much better ways (look up modulo if you want) but this is probably a good exercise on loops, so whatever.
About your bug. Look carefully at the for loop.
for (int i = 0; i <= value; i + 2)
Will i ever change? If you go: w = i + 2, does that change i? Think about it.
You've probably got it already. i just stays 0, so it sits there forever checking if i is less than value. It always is. So your program never ends. what you meant was i +
= 2. Which makes your loop:
for (int i = 0; i <= value; i += 2)
EDIT: NatasDM, that's an evil thing to suggest in a beginners forum.