Code Snippets C

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