diff options
-rw-r--r-- | src/hexout.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/hexout.c b/src/hexout.c new file mode 100644 index 0000000..1af6805 --- /dev/null +++ b/src/hexout.c | |||
@@ -0,0 +1,13 @@ | |||
1 | #include <stdio.h> | ||
2 | |||
3 | int main() { | ||
4 | char tbl[] = "0123456789ABCDEF"; | ||
5 | int in; | ||
6 | |||
7 | while( ( in = getchar() ) != EOF ) { | ||
8 | putchar( tbl[in>>4]); | ||
9 | putchar( tbl[in&15]); | ||
10 | putchar( '\n' ); | ||
11 | } | ||
12 | return 0; | ||
13 | } | ||