summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hexout.c13
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
3int 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}