This has nothing to do with "out of the box" answers. I deleted your answer because I didn't think it was a good-faith attempt to provide a serious, helpful answer to the question. I read it as a slightly sarcastic joke response.
Here's why:
- You have a single English sentence that serves no purpose but to support a pun; it offers no explanation for the solution you're proposing
- You include a bunch of non-obvious code that is of very little help to a novice C programmer
- Your code only works on one specific case given by OP, not in the general case
- Your code contains a single comment that I interpret as sarcastic:
No "?:" in sight!!
- this was never a stated goal of OP, and simply avoiding ?:
is trivially done any number of ways; in fact, ?:
was never necessary or appropriate here in the first place, so removing it is hardly novel
- If your answer is on-topic, then an arbitrary number of silly answers are also on-topic, for example
while (x == y) x *= 2;
is on-topic.
In all, I read your answer as a joke, riffing on the OP's (IMO) misguided requirement to avoid the simple if
statement that is the obvious answer to their problem. If you wanted to offer a semi-serious suggestion that only partially addressed the question, a comment would have sufficed.
You have also repeatedly argued that another answer was unjustly left alone; the fundamental difference is I believed that answer was a good faith attempt to help OP, and by the time I had seen that answer it had also been edited to explicitly and directly answer the question (offering a GCC flag to do exactly what OP had asked about).
if(x == y) do_something;
is also not specific to mathematical operations.do_something
has been given ONLY as mathematical operations... Who decides thatdo_something
means a broader range of possibilities???:
would not answer a question about whether anelse
block is necessary afterif
. (It doesn't actually matter, in this analysis, whether the answer to the original question is "yes" or "no".)for( )
expression that would not be "if( )` yet woulddo_something
only once under a given condition... Who minds the minders? And, why is "thinking outside the box" penalised on SO?