Logical operators are used to connect multiple conditions within a if..else.. statement. The different types of Logical operators are as follows:
- AND Operator: &&:
- OR Operator: ||
- NOT Operator: !
Working of the Logical operators may be explained in the following way.
If two conditions are connected by a AND (&&) Operator: i.e.
if ( condition 1 && condition 2 )
Then, the statement is executed, only when both condition 1 and condition 2 are TRUE
If two conditions are connected by an OR (||) Operator: i.e.
if ( condition 1 || condition 2 )
Then, the statement is executed, when any one of the conditions is TRUE
About our authors: Team EQA
You have viewed 1 page out of 248. Your C learning is 0.00% complete. Login to check your learning progress.
Learn on Youtube