From d31e8c54639c954fbdcaf4155f13f8ad2d082215 Mon Sep 17 00:00:00 2001 From: Laurin Date: Tue, 6 Feb 2024 14:02:28 +0100 Subject: [PATCH] Implemented interface and functions to convert from or into binary system in main program --- src/conversionOfNumbers/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/conversionOfNumbers/main.c b/src/conversionOfNumbers/main.c index 375e414..fe9d7ec 100644 --- a/src/conversionOfNumbers/main.c +++ b/src/conversionOfNumbers/main.c @@ -24,6 +24,18 @@ int main(){ "<2> Hauptmenue\n"); InputProg = usergetd("\nEingabe: ", &min, &max); if(InputProg == 2) break; + if(InputSys == 0){ + if(InputProg == 0){ + char* toConvert = usergets("\nGeben Sie eine Zeichenkette von 0 und 1 ein: ", NULL, NULL); + int result = convertBinaryStrToInt(toConvert); + printf("\nAusgabe (in Dezimal): %d\n", result); + } + if(InputProg == 1){ + int toConvert = usergetd("\nGeben Sie eine Ganzzahl ein: ", NULL, NULL); + char* result = convertIntToBinaryStr(toConvert); + printf("\nAusgabe (in Binaer): %s\n", result); + } + } } } return 0;