Use bit shift to calculate : Bit Shift « Data Type « C / ANSI-C






Use bit shift to calculate

#include <stdio.h>

int main(void)
{
  int i = 1;

  i <<= 3;  /* multiply by 2, 3 times */

  printf("%d", i);

  return 0;
}

           
       








Related examples in the same category

1.A bit shift exampleA bit shift example
2.Shift bitwise and display the resultShift bitwise and display the result
3.Shift statement in for