From b6391bbfa8707eae7e32c2f0a2a4e10999c5155f Mon Sep 17 00:00:00 2001 From: fdai7754 Date: Sun, 4 Feb 2024 16:00:28 +0100 Subject: [PATCH] refactoring: funktion stunden --- src/ageinseconds.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ageinseconds.c b/src/ageinseconds.c index d26d3e9..4e0db40 100644 --- a/src/ageinseconds.c +++ b/src/ageinseconds.c @@ -11,6 +11,11 @@ int minuten(int jahre) { return erg; } +int stunden(int jahre) { + int erg = jahre * 8760; + return erg; +} + int run_ageinseconds() { int age; @@ -19,7 +24,7 @@ int run_ageinseconds() { printf("-------------------------------------------------"); printf("\nDu bist: %d Sekunden alt", sekunden(age)); printf("\n-------------------------------------------------"); - printf("\nDas sind %d in Minuten und %d in Stunden", minuten(age), age * 365 * 24); + printf("\nDas sind %d in Minuten und %d in Stunden", minuten(age), stunden(age)); printf("\n-------------------------------------------------"); return 0; } \ No newline at end of file