|
@ -1,5 +1,19 @@ |
|
|
#include <stdio.h> |
|
|
#include <stdio.h> |
|
|
#include <stdlib.h> |
|
|
#include <stdlib.h> |
|
|
|
|
|
#include <math.h> |
|
|
|
|
|
|
|
|
|
|
|
#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){ |
|
|
char* convertIntToBinaryStr(int input){ |
|
|
if(input > 3 || input < 0) return NULL; |
|
|
if(input > 3 || input < 0) return NULL; |
|
|