diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-03 08:22:28 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-03 08:22:28 +0000 |
commit | 5fe32a2f3c2c247059a2f91b42f03b652e58fe81 (patch) | |
tree | 29495f7f6e650971a8be404016d30b71ac39c08b | |
parent | 91c5ac8b98fa6c508e81c1d526c9e69e868c5d94 (diff) |
Sun, Dec 3, 2023, 12:22 AM -08:00
-rw-r--r-- | wk1/lab1/population.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wk1/lab1/population.c b/wk1/lab1/population.c index da8a857..e094e19 100644 --- a/wk1/lab1/population.c +++ b/wk1/lab1/population.c @@ -3,7 +3,7 @@ int main(void) { - float n; + int n; do { n = get_int("Start size: "); @@ -18,8 +18,8 @@ int main(void) int year = 0; while (n < end) { - n += (n / 12); + n += (float) (n / 12); year++; } - printf("%f Years: %i\n", n, year); + printf("%d Years: %i\n", n, year); } |