Home > Back-end >  Why is the first right, second is wrong, if statement, relational operators.
Why is the first right, second is wrong, if statement, relational operators.

Time:10-08

CodePudding user response:

N no matter how much is, it is valid,
If ((1 & lt;=n) & lt; Write=10), usually it does not recommend this

CodePudding user response:

1<=nThe execution result is first 1 & lt;=n judgement, the result is 0 or 1, then use the result to do & lt;=10 to judgment, the result is always a true
In grammar, the sentence is right

But said the meaning of obviously not 1 & lt;=n & amp; & n<=10, therefore, the second is wrong

CodePudding user response:

Ha ha

Longed for class in-class test

CodePudding user response:

I go, I write for 10 + years haven't seen someone so write
  • Related