[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
outputting bits in C
- To: http://www.testman.com/~r (Richard), http://www.juno.com/~w1few (Richard), http://www.nh.ultranet.com/~bhavani (Richard)
- Subject: outputting bits in C
- From: http://dummy.us.eu.org/robert (robert)
- Date: Wed, 16 Jan 2002 15:25:13 -0500
- Keywords: bit-by-bit
main()
{
int i=4958;
char arr[17];
int j;
j=15;
arr[16]='\0';
while (i) {
arr[j]='0'+(i&1);
i>>=1;
j--;
}
printf("%s\n", arr);
}