0
Give output without run this code.
2 ответов
+ 2
So what's your question?
Why the y stays at 4?
Because if the first expression in an logical or statement is already true, there is no need to execute the second expression. Either if the second one would be true or false, the condition is true anyways because of or-logic.
+ 1
There is a short circuit evaluating in if condition.
Evaluating from left to right.
First ++x>6 is true so the second condition will not be evaluate ! Thus y remains 4.