summaryrefslogtreecommitdiff
path: root/wk1/lab1/population.c
blob: 0e9c32df9b7a289d9434ba65ecb6b0e45fd96c77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <cs50.h>

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);
    }
    printf("Years: %i", year);
}