Browse Source

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

remotes/origin/conversionOfNumbers
Laurin 11 months ago
parent
commit
2157c6a2f4
  1. 13
      src/conversionOfNumbers/main.c

13
src/conversionOfNumbers/main.c

@ -36,6 +36,19 @@ int main(){
printf("\nAusgabe (in Binaer): %s\n", result); printf("\nAusgabe (in Binaer): %s\n", result);
} }
} }
if(InputSys == 1){
if(InputProg == 0){
char* toConvert = usergets("\nGeben Sie eine Zeichenkette im Hexadezimal-Format ein: ", NULL, NULL);
int result = convertHexStrToInt(toConvert);
printf("\nAusgabe (in Dezimal): %d\n", result);
}
if(InputProg == 1){
int rangeMin = 0;
int toConvert = usergetd("\nGeben Sie eine positive Ganzzahl ein: ", &rangeMin, NULL);
char* result = convertIntToHex(toConvert);
printf("\nAusgabe (in Hex): %s\n", result);
}
}
} }
} }
return 0; return 0;
Loading…
Cancel
Save