← Logical Operators & the Ternary Operator

Short-Circuit Safety

medium

Print Yes if b is nonzero and a / b > 1; otherwise print No. Some of the test cases set b to 0 – your program has to handle that without crashing, which means the division must never actually execute in that case.

This only works because of short-circuit evaluation, and only in one specific order: put b != 0 on the left of &&. If C sees that’s false, it skips evaluating a / b > 1 entirely – the safety check has to run first for the short-circuit to protect you.

Your solution

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

Test results

Submit your solution to run it against all test cases.

Hints

    Reference solution