summaryrefslogtreecommitdiff
path: root/wk1/lab1/population.c
blob: 3d622a9ce0c79024fcf7fc7d4e4cbb98ea60f902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#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/12);
        year++;
    }
    printf("Years: %i\n", year);
}