if (x <= value <= y)

Nov 8, 2013 at 12:27am
Write your question here.
Correctly recode the statement:
is x<=y correct?
Nov 8, 2013 at 12:34am
Nope, x <= y isn't correct, sorry.

You're missing a logical operation and another comparison somewhere.

-Albatross
Nov 8, 2013 at 12:35am
These are two conditions:
1. x is less or equal to value
2. y is greater or equal to value
So you need to name both of them and use logical operator AND (&&).
Nov 8, 2013 at 12:48am
if ((x<=value)&&(value<=y))
{
do something
}
Topic archived. No new replies allowed.