Introduction To Programming

Why programs ? Programming is nothing but making the computers think the same way a human thinks. Programs are made for obtaining a specific solution which can even be solved by humans which when solved by us may consume time..

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