Browse Source

kabrel

remotes/origin/develop
fdai7801 11 months ago
parent
commit
9fb9199189
  1. 19
      src/main/c/BasicMode.c
  2. 4
      src/main/c/BasicMode.h

19
src/main/c/BasicMode.c

@ -2,7 +2,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <stdio.h>
#include "BasicMode"
// convert decimal to binary // convert decimal to binary
@ -32,3 +32,20 @@ long long int BinToDec(long long int n) {
return dec; 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;
}

4
src/main/c/BasicMode.h

@ -3,5 +3,9 @@
long long int DecToBin(long long int n); long long int DecToBin(long long int n);
long long int BinToDec(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 #endif // BasicMode
Loading…
Cancel
Save