home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / tyc / list20_6.c < prev    next >
C/C++ Source or Header  |  1993-10-16  |  327b  |  18 lines

  1.  /* Demonstrating the shift operators. */
  2.  
  3.  #include <stdio.h>
  4.  
  5.  main()
  6.  {
  7.      unsigned char y, x = 255;
  8.      int count;
  9.  
  10.      printf("Decimal\t\tshift left by\tresult\n");
  11.  
  12.      for (count = 1; count < 8; count++)
  13.      {
  14.           y = x << count;
  15.           printf("%d\t\t%d\t\t%d\n", x, count, y);
  16.      }
  17.  }
  18.