Page 35 - 6437
P. 35

unsigne           =             /* 60 =
                                      d int             60;                    0011    100 /
                                             unsigne           =             /* 13 =
                                      d int int c = 0;   13;                   0000    101 /




                                             c = a &           /*        = 0000
                                      b; printf("Line   12       1100 */
                                                               -         of c is     );
                                                        Value    %d\n",

                                             c = a |           /*        = 0011
                                      b; printf("Line   61       1101 */
                                                               -         of c is     );
                                                        Value    %d\n",

                                             c = a ^           /*        = 0011
                                      b; printf("Line   49       0001 */
                                                               -         of c is     );
                                                        Value    %d\n",

                                             c = ~a;           /*        = 1100
                                      printf("Line      -61      0011 */
                                                               -         of c is     );
                                                        Value    %d\n",

                                             c = a             /*        = 1111
                                      << 2;                240   0000 */
                                             printf("           -        of c is     );
                                      Line                Value  %d\n",



                    c = a >> 2;         /* 15 = 0000 1111 */

                    printf("Line 6 - Value of c is %d\n", c );


                 }

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

                                                  -
                                    ine   Value      f     s   2
                                                  -
                                    ine   Value      f     s   1
                                                  -
                                    ine   Value      f     s   9
                                                  -
                                    ine   Value      f     s  61
                                                                                                      37
   30   31   32   33   34   35   36   37   38   39   40