#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int input = atoi(argv[1]);
int i;
char bit_array[8];
for(i=0;i<8;i++)
{
bit_array[7-i] = (input >> i) & 0x01;
}
for(i=0;i<8;i++)
{
printf("%d", bit_array[i]);
}
return 0;
}
gcc -o shift shift.c
./shift 5[255, 3]