Wednesday, January 25, 2012

Logical Operators

In C language, there are 3 types of logical operators which are used.

  1. && – Used for AND operation.
  2. || – Used for OR operation.
  3. ! – Used for NOT operation.
When we want to apply two conditions to occur simultaneously in any condition based structure, we need to use AND operator. In  C language, AND operator is represented by && sign.
When we want to apply either of two or more conditions to occur, in any condition based structure, then we need to use OR operator. In C language, OR operator is represented by || sign.

And as we have seen the function of NOT operator in logic gate diagram, the same function is served in C language. However the detailed function of the NOT operator will be explained in the later article.

No comments:

Post a Comment

Please give your valuable comments or queries if you fell its helpful or if you like the contents of the site. Thanks...