clear; clc;

balance = 100;
r = 0.10;
goal = 200;
years = 0;

while balance < goal
    balance = balance * (1 + r);
    years = years + 1;
end

balance
years