Logical expression. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Logical expression.

I need a help on logical expressions such as "<" and ">" operators. Is this expression "a<b<c" is valid? Anyone can explain?

30th May 2020, 12:16 AM
Justin VI
2 Réponses
+ 5
It depends on the language: it is valid in Python, for example, but not valid in languages with C-like syntax. You can achieve the same logic by doing (a < b) && (b < c).
30th May 2020, 12:29 AM
Eduardo Petry
Eduardo Petry - avatar
+ 1
Oh! Ok. Thanks. Now i am learning C++ and the question was releted to that.
30th May 2020, 12:32 AM
Justin VI