cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
if (x <= value <= y)
if (x <= value <= y)
Nov 8, 2013 at 12:27am UTC
stevencalabrese
(5)
Write your question here.
Correctly recode the statement:
is x<=y correct?
Nov 8, 2013 at 12:34am UTC
Albatross
(4553)
Nope, x <= y isn't correct, sorry.
You're missing a logical operation and another comparison somewhere.
-Albatross
Nov 8, 2013 at 12:35am UTC
JockX
(293)
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 UTC
alhajee
(1)
if ((x<=value)&&(value<=y))
{
do something
}
Topic archived. No new replies allowed.