C++ class question

How does the mathematical expression (3 ≤ n)∧(n ≤ 7) translate to C++?
bool result = ((3 <= n) && !(n <= 7)) || (!(3 <= n) && (n <= 7));

result is true when (3 <= n) is true and (n <= 7) is false
result is true when (3 <= n) is false and (n <= 7) is true

result is false when (3 <= n) is false and (n <= 7) is false
result is false when (3 <= n) is true and (n <= 7) is true

Not sure if that's what you wanted, but that's my best guess.
I have to ask: What is the ?

Wiki says "logical and". If so, then the expression states that n should be between 3 and 7.
(3 <= n) && (n <= 7)
Topic archived. No new replies allowed.