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

C++ Logical Operators

Can I use Logical operators in a loop's condition? The tutorial only mentions them with the if statements.

1st Sep 2017, 5:16 PM
Christos Provopoulos
2 Réponses
+ 6
Yes, as long as the condition returns true or false you can use pretty much anything (or nothing in the case of a for loop), including functions/methods.
1st Sep 2017, 5:23 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
@ChaoticDawg Ok thank you :-) I must have made some mistakes trying this out...
1st Sep 2017, 6:08 PM
Christos Provopoulos