From 4ed0119ebd79f45e4fd74efea014c8c4f7f2483f Mon Sep 17 00:00:00 2001 From: fdai7754 Date: Sun, 4 Feb 2024 15:52:33 +0100 Subject: [PATCH] refactoring: funktion sekunden --- src/ageinseconds.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ageinseconds.c b/src/ageinseconds.c index 63429ae..d1a61d4 100644 --- a/src/ageinseconds.c +++ b/src/ageinseconds.c @@ -1,15 +1,20 @@ #include #include "ageinseconds.h" +int sekunden(int jahre) { + int erg = jahre * 31536000; + return erg; +} + int run_ageinseconds() { int age; printf("Dein Alter: "); scanf("%d", &age); printf("-------------------------------------------------"); - printf("\nDu bist: %d Sekunden alt", age * 365 * 24 * 60 * 60); + printf("\nDu bist: %d Sekunden alt", sekunden(age)); printf("\n-------------------------------------------------"); printf("\nDas sind %d in Minuten und %d in Stunden", age * 365 * 24 * 60, age * 365 * 24); printf("\n-------------------------------------------------"); return 0; -} +} \ No newline at end of file