C: What will be the statement "A" 1 'for A> 1?
Although I myself would not write it, what is the expected result of the following statement, where A(guaranteed to be zero or a positive integer) is greater than 1?
return A || 1;
In many languages, I would expect it to Abe returned if the value Ais zero, in which case 1 will be.
I do not have my C book, but I note that the value 1 is actually always returned. Is this the result of compiler optimization or the potential ambiguity of the expression, is it that the return value is non-deterministic?