From 9544c46b3cc04d5ad92a696ab0627623aeeb4f4d Mon Sep 17 00:00:00 2001 From: INNA Date: Thu, 8 Feb 2024 20:05:36 +0100 Subject: [PATCH] =?UTF-8?q?Hinzuf=C3=BCgen=20von=20Dezimalzahl-Division=20?= =?UTF-8?q?und=20Index-Inkrementierung=20in=20der=20Umwandlungsschleife?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/decbinary.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/decbinary.c b/src/decbinary.c index 55e179b..cc3b003 100644 --- a/src/decbinary.c +++ b/src/decbinary.c @@ -9,6 +9,8 @@ int dezimal_zu_binär(int dezimalzahl) { while (dezimalzahl > 0) { binärzahl[i] = dezimalzahl % 2; + dezimalzahl /= 2; + i++; } return i;