@ -276,3 +276,10 @@ int ByOne(int n) {
}
return count;
int dezimal_to_bin(int dezimal) {
if (dezimal == 0) {
return 0;
} else {
return (dezimal % 2 + 10 * dezimal_to_bin(dezimal / 2));
@ -44,5 +44,6 @@ float vPunkt(float x1, float x2, float x3, float z1, float z2, float z3, float p
double probability_from_tree(double successful_outcomes, double total_outcomes, double branches);
int binomial_coefficient(int n, int k);
int ByOne(int n);
int dezimal_to_bin(int dezimal);
#endif
@ -7,7 +7,7 @@
int main()
{
double a,b,c,d,h,x1,s1,x2,x3,z1,z2,z3,p1,p2,p3,m,x,y,z;
int n;
int n,dezimal;
a = getValue('a');
b = getValue('b');
h = getValue('h');
@ -208,4 +208,8 @@ int main()
n = getValue('X');
ByOne(n);
printf("Bitte geben sie eine Zahl ein!");
dezimal = getValue('X');
dezimal_to_bin(dezimal);