diff --git a/src/outputHandling.c b/src/outputHandling.c index b38a651..0a00670 100644 --- a/src/outputHandling.c +++ b/src/outputHandling.c @@ -2,7 +2,14 @@ #include "outputHandling.h" #include "inputHandling.h" +void hex(char* string, int number) { + sprintf(string, "%X", number); +} void printResult(calc_op* result) { - printf("Das Ergebnis ist: %f", result->result); + char buf[60] = {0}; + printf("Das Ergebnis ist: %f\n", result->result); + printf("Das Ergebnis in int: %i\n",(int)result->result); + hex(buf, (int)result->result); + printf("Das Ergebnis in hex: 0x%s\n", buf); ; } \ No newline at end of file