You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
249 B
17 lines
249 B
#include <stdio.h>
|
|
#include "decbinary.h"
|
|
|
|
int decimal_to_binary(int dezimalzahl) {
|
|
|
|
|
|
int binärzahl[32];
|
|
int i = 0;
|
|
|
|
while (dezimalzahl > 0) {
|
|
binärzahl[i++] = dezimalzahl % 2;
|
|
dezimalzahl /= 2;
|
|
}
|
|
|
|
return i;
|
|
}
|
|
|