Logical Operations

Top 

 

!   Usage: !ae

   True, if ae or pe is false.

   Example:

     if (!good)

       printf ("not good");

||  Usage: e1 || e2

 

   checked. The value of e2 will be checked only, if e1 is False. The expression       will be

   True, if e1 or e2 is True.

   Example:

     if(x < A || x > B) printf

      ("out of range");

&&

    Logical AND operation of e1 and e2. At first, the value of e1

    is checked. The value of e2 will be checked only, if e1 is True.

    The expression will be True, if e1 and e2 are True.

    Example:

      if (a ! = 0 && b > 7)

        n++;