← Logical Operators & the Ternary Operator

Range Check

easy

Read value, low, and high, and print In range if value falls within [low, high] inclusive, otherwise Out of range.

A tempting but wrong instinct here is to write low <= value <= high directly, the way you would on paper. That actually compiles in C – but not because C understands chained comparisons. It parses as (low <= value) <= high: the first comparison produces 0 or 1, and that gets compared against high, which is almost never what you meant. Use && to combine two independent comparisons instead.

Your solution

"Run" uses the sample stdin ("5 1 10"). "Submit" checks your code against all 5 test cases.

Test results

Submit your solution to run it against all test cases.

Hints

    Reference solution