Browse Source

Implemented interface and functions to convert from or into binary system in main program

remotes/origin/conversionOfNumbers
Laurin 11 months ago
parent
commit
d31e8c5463
  1. 12
      src/conversionOfNumbers/main.c

12
src/conversionOfNumbers/main.c

@ -24,6 +24,18 @@ int main(){
"<2> Hauptmenue\n"); "<2> Hauptmenue\n");
InputProg = usergetd("\nEingabe: ", &min, &max); InputProg = usergetd("\nEingabe: ", &min, &max);
if(InputProg == 2) break; 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; return 0;
Loading…
Cancel
Save