Page 33 - 6437
P. 33

{

                                   printf("Line 3 - Condition is not true\n" );

                                }
                                if ( !(a && b) )
                                {

                                   printf("Line 4 - Condition is true\n" );
                                }

                            }

                          When you compile and execute the above program, it produces the following result:



                 Line 1 - Condition is true

                 Line 2 - Condition is true
                 Line 3 - Condition is not true

                 Line 4 - Condition is true
                          Bitwise Operators
                          Bitwise operators work on bits and perform bit-by-bit operation. The truth table for &, |,
                   and ^ is as follows:


                               p                 q                 p & q             p | q             p ^ q


                               0                 0                 0                 0                 0


                               0                 1                 0                 1                 1


                               1                 1                 1                 1                 0


                               1                 0                 0                 1                 1


                          Assume A = 60 and B = 13; in binary format, they will be as follows: A = 0011 1100
                          B = 0000 1101
                          -----------------











                                                                                                      35
   28   29   30   31   32   33   34   35   36   37   38