Monday, May 24, 2010

Short circuit operators

Short circuit operator is operator in which first operand of expression is evaluated , the second operand is evaluated if it is necessary.

Short circuit operators in c programming are &&(Logical AND), ||(Logical OR).

Logical AND:
In logical AND operator expression if the first operand is false then it is no need of evaluating the second operand.

Logical OR:
In Logical OR operator expression if the first operand is true then it is no need of evaluating the second operand.

AND operator example
OR operator example

0 comments:

Post a Comment