git.samba.org
/
tridge
/
junkcode.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
use non-zero data
[tridge/junkcode.git]
/
bits.c
1
#include <stdio.h>
2
3
4
bits(unsigned int x)
5
{
6
int i;
7
for (i=0;i<8;i++)
8
if (x & (1<<i))
9
putchar('1');
10
else
11
putchar('0');
12
}
13
14
main()
15
{
16
unsigned char x;
17
for (x='a';x<='z';x++)
18
{
19
printf("%c ",x);
20
bits(x);
21
printf(" ");
22
bits(toupper(x));
23
printf("\n");
24
}
25
26
}