/** * Bit shifting example. * @author gtowell * Created: April 2020 * **/ #include int main(int argc, char const *argv[]) { unsigned char uc = 0; uc = 1; for (int i = 0; i < 12; i++) { printf("Step:%2d UC:%6d\n", i, uc); //uc = uc << 1; uc <<= 1; } uc = 255; unsigned char uuc = uc; for (int i = 0; i < 10; i++) { printf("Down Step:%2d UC:%6d UUC:%6d\n", i, uc, uuc); uc >>= 2; uuc /= 4; } return 0; }