diff --git a/src/ageinseconds.c b/src/ageinseconds.c index 4bc3512..f04746c 100644 --- a/src/ageinseconds.c +++ b/src/ageinseconds.c @@ -1,8 +1,8 @@ #include #include "ageinseconds.h" -int sekunden(int jahre) { - int erg = jahre * 31536000; +float sekunden(float jahre) { + float erg = jahre * 31536000; return erg; } @@ -73,7 +73,7 @@ int run_ageinseconds() { printf("Dein Alter: "); scanf("%d", &age); printf("-------------------------------------------------"); - printf("\nDu bist: %d Sekunden alt", sekunden(age)); + printf("\nDu bist: %0.f Sekunden alt", sekunden(age)); printf("\n-------------------------------------------------"); printf("\nDas sind %d in Minuten und %d in Stunden", minuten(age), stunden(age)); printf("\n-------------------------------------------------\n"); diff --git a/src/ageinseconds.h b/src/ageinseconds.h index 2b7a006..a951506 100644 --- a/src/ageinseconds.h +++ b/src/ageinseconds.h @@ -1,7 +1,7 @@ #ifndef AGEINSECONDS_H #define AGEINSECONDS_H -int sekunden(int jahre); +float sekunden(float jahre); int minuten(int jahre); int stunden(int jahre);