From 35f27710a3a95253a74df823a212612780ff9dee Mon Sep 17 00:00:00 2001 From: Kevin Ludwig Date: Wed, 7 Feb 2024 19:38:49 +0100 Subject: [PATCH] =?UTF-8?q?Celsius=20zu=20Fahrenheit=20funktion=20f=C3=BCr?= =?UTF-8?q?=20berechnung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/temperatur.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/temperatur.c b/src/temperatur.c index c5de411..7a18e9e 100644 --- a/src/temperatur.c +++ b/src/temperatur.c @@ -1,5 +1,9 @@ #include +float CzuF(float tempC){ + return (tempC * 9/5) + 32; +} + int run_TemperaturRechner(){ float var1; int var3; @@ -12,8 +16,8 @@ int run_TemperaturRechner(){ printf("\nGeben Sie die Temperatur ein: "); scanf("%f", &var1); - printf("\nErgebnis: %.2f\n", (var1 * 9/5) +32); + printf("\nErgebnis: %.2f\n", CzuF(var1)); return 0; -} +} \ No newline at end of file