summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-04-07 02:35:46 +1000
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-04-07 02:35:46 +1000
commitfbca225d25db812fe7823a8528dff17320cf1c53 (patch)
treef99d672c7245233814cd038fd683ef8bf4270961 /test.c
parent4b2952578ece47358960e29825443f77070a7457 (diff)
commit so I can access it tomorrow.
Diffstat (limited to 'test.c')
-rw-r--r--test.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/test.c b/test.c
deleted file mode 100644
index e1898c3..0000000
--- a/test.c
+++ /dev/null
@@ -1,25 +0,0 @@
-// BCD
-#include"stdio.h"
-
-int toBCD(int x){
- if (x < 100){
- int a = ((x / 10) << 4);
- int b = (x % 10);
- return (a + b);
- }
- else{
- fprintf(stderr, "Number greater than 99 passed to toBCD()");
- }
-}
-
-int fromBCD(int x){
- int a = ((x >> 4) * 10);
- int b = (x & 0xF);
- return (a + b);
-}
-
-int main (){
- int i = 39;
- printf("1. %d\n2. %d\n3. %d\n", i, toBCD(i), fromBCD(toBCD(i)));
- return 0;
-} \ No newline at end of file