From 9fb9199189e4964b538ce2e12b6abbae774fde22 Mon Sep 17 00:00:00 2001 From: fdai7801 Date: Fri, 9 Feb 2024 21:52:17 +0100 Subject: [PATCH] kabrel --- src/main/c/BasicMode.c | 19 ++++++++++++++++++- src/main/c/BasicMode.h | 4 ++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/main/c/BasicMode.c b/src/main/c/BasicMode.c index 0b1bc48..95879f0 100644 --- a/src/main/c/BasicMode.c +++ b/src/main/c/BasicMode.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include "BasicMode" // convert decimal to binary @@ -32,3 +32,20 @@ long long int BinToDec(long long int n) { return dec; } +//addition +long long int addition(long long int a, long long int b) { + long long int dec1, dec2; + dec1 = BinToDec(a); + dec2 = BinToDec(b); + dec1 = dec1 + dec2; + dec2 = DecToBin(dec1); + + return dec2; +} + +int main() { + + + + return 0; +} diff --git a/src/main/c/BasicMode.h b/src/main/c/BasicMode.h index 69969a8..454f8ac 100644 --- a/src/main/c/BasicMode.h +++ b/src/main/c/BasicMode.h @@ -3,5 +3,9 @@ long long int DecToBin(long long int n); long long int BinToDec(long long int n); +long long int addition(long long int a, long long int b); + + + #endif // BasicMode