summaryrefslogtreecommitdiff
path: root/wk1/lab1/population.c
diff options
context:
space:
mode:
Diffstat (limited to 'wk1/lab1/population.c')
-rw-r--r--wk1/lab1/population.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/wk1/lab1/population.c b/wk1/lab1/population.c
index 0e9c32d..3925e82 100644
--- a/wk1/lab1/population.c
+++ b/wk1/lab1/population.c
@@ -6,12 +6,11 @@ int main(void)
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);
- }
+ //while (n <= end)
+ //{
+ n = n + (n/3);
+ n = n - (n/4);
+ year = year + 1;
+ //}
printf("Years: %i", year);
}