diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-03 06:10:10 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-03 06:10:10 +0000 |
commit | 2edb0b5c21b754263477f5db336e49faf2fe40bd (patch) | |
tree | aaf41626aad77ed8f40bfce5162d54be2a5f2e1b /wk1/lab1 | |
parent | de47e3e42cc2ea518e423d2617b7888f69a7e426 (diff) |
Sat, Dec 2, 2023, 10:10 PM -08:00
Diffstat (limited to 'wk1/lab1')
-rw-r--r-- | wk1/lab1/population.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/wk1/lab1/population.c b/wk1/lab1/population.c index c95d844..0e9c32d 100644 --- a/wk1/lab1/population.c +++ b/wk1/lab1/population.c @@ -3,6 +3,15 @@ int main(void) { - int start = get_int("Starting number of llamas: "); - int end = get_int("Ending number of "); + int n = get_int("Start size: "); + int end = get_int("End size: "); + int year = 0; + while (n < end) + { + n += n/3; + n -= n/4; + year++; + printf("%i", year); + } + printf("Years: %i", year); } |