#include <stdio.h>
#include <stdlib.h>
int main(void) {
int n = 3;
for (int i = 0; i < 5; 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: 11 | 3
Left shift by 1: 110 | 6
Left shift by 2: 1100 | 12
Left shift by 3: 11000 | 24
Left shift by 4: 110000 | 48
*/