|
|
@ -6,10 +6,16 @@ void hex(char* string, int number) { |
|
|
|
sprintf(string, "%X", number); |
|
|
|
} |
|
|
|
|
|
|
|
void oct(char* string, int number) { |
|
|
|
sprintf(string, "%o", number); |
|
|
|
} |
|
|
|
|
|
|
|
void printResult(calc_op* result) { |
|
|
|
char buf[60] = {0}; |
|
|
|
printf("Das Ergebnis ist: %f\n", result->result); |
|
|
|
printf("Das Ergebnis in int: %i\n",(int)result->result); |
|
|
|
printf("Das Ergebnis in dec: %i\n",(int)result->result); |
|
|
|
hex(buf, (int)result->result); |
|
|
|
printf("Das Ergebnis in hex: 0x%s\n", buf); ; |
|
|
|
oct(buf, (int)result->result); |
|
|
|
printf("Das Ergebnis in oct: %s\n", buf); ; |
|
|
|
} |