#include
#include
int main(void)
{
char ch;
int i;
printf("Enter a character: ");
ch = getche();
printf("\n");
/* display binary representation */
for(i = 128; i > 0; i = i / 2){
if(i & ch)
printf("1 ");
else
printf("0 ");
}
return 0;
}