Logical Operators:

Logical operators are used to connect multiple conditions within a if..else.. statement. The different types of Logical operators are as follows:

  1. AND Operator: &&:
  2. OR Operator: ||
  3. 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 252. Your C learning is 0.00% complete. Login to check your learning progress.

#