#include <stdio.h>
#include <stdlib.h>
int main(void) {
int n = 8;
for (int i = 0; i < 10; i++) {
char bits[17];
itoa((n >> i) ,bits, 2);
printf("Left shift by %d: %s | %d\n", i, bits, n >> i);
}
return 0;
}
/*
run:
Left shift by 0: 1000 | 8
Left shift by 1: 100 | 4
Left shift by 2: 10 | 2
Left shift by 3: 1 | 1
Left shift by 4: 0 | 0
Left shift by 5: 0 | 0
Left shift by 6: 0 | 0
Left shift by 7: 0 | 0
Left shift by 8: 0 | 0
Left shift by 9: 0 | 0
*/