Browse Source

auswahlspezifische ausgabe

remotes/origin/temperaturdev
Kevin Ludwig 11 months ago
parent
commit
5ea71dbc5e
  1. 13
      src/temperatur.c

13
src/temperatur.c

@ -36,6 +36,17 @@ const char* getFirstUnit(int input){
return "Kelvin"; return "Kelvin";
return ""; return "";
} }
const char* getSecondUnit(int input){
if(input == 1 || input == 6)
return "° Fahrenheit";
else if(input == 2 || input == 4)
return " Kelvin";
else if(input == 3 || input == 5)
return "° Celsius";
return "";
}
int run_TemperaturRechner(){ int run_TemperaturRechner(){
float var1, var2; float var1, var2;
@ -71,7 +82,7 @@ int run_TemperaturRechner(){
break; break;
} }
printf("\nErgebnis: %.2f\n", var2);
printf(" = %.2f%s\n\n", var2, getSecondUnit(var3));
return 0; return 0;

Loading…
Cancel
Save