decToBin
unknown
c_cpp
3 years ago
246 B
20
Indexable
void decToBinRec(unsigned int n){
if (n != 0){
decToBinRec(n / 2);
if (n % 2 == 0) printf("%d", 0);
else printf("%d", 1);
}
}
void decToBin(unsigned int n){
if (n == 0) printf("%d", 0);
decToBinRec(n);
}Editor is loading...