Order of logical operators
Afficher commentaires plus anciens
1 < 5 > 2 gives false
1 commentaire
John D'Errico
le 13 Oct 2018
There is no need to close a question that has had answers provided. In fact, doing so removes the value of the answer provided for others to read.
Réponse acceptée
Plus de réponses (1)
KALYAN ACHARJYA
le 13 Oct 2018
Modifié(e) : KALYAN ACHARJYA
le 13 Oct 2018
Here Logic is false
1 < 5 > 2
1<5 gives 0
and 0>2 false
so Ans 0
If you do others
3>2>0 gives you 1
as 3>2 true gives 1, which is > 0
Ans 1
Hope it clears your doubt
2 commentaires
Akash Sinhal
le 13 Oct 2018
KALYAN ACHARJYA
le 13 Oct 2018
Modifié(e) : KALYAN ACHARJYA
le 13 Oct 2018
Because 1<5 True its gives you 1, next 1>2 False, so result false
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!