diff --git a/src/conversionOfNumbers/conversionOfNumbers.c b/src/conversionOfNumbers/conversionOfNumbers.c index b7ae51b..d614913 100644 --- a/src/conversionOfNumbers/conversionOfNumbers.c +++ b/src/conversionOfNumbers/conversionOfNumbers.c @@ -1,5 +1,19 @@ #include #include +#include + +#include "conversionOfNumbers.h" + +int binaryStrLen(int input){ + int length; + for(int x = 0; x < input; x++){ + if(pow(2,x) >= input + 1){ + length = x; + break; + } + } + return length; +} char* convertIntToBinaryStr(int input){ if(input > 3 || input < 0) return NULL;