Elementary, dear Watson ...
int points = 0;
int goal = 100;
while (goal <= 100) {
for (int i = 0; i < goal; i++) {
if (points > 50) {
goal++;
break;
}
points += i;
}
}
or
int points = 0;
int goalim = goal = 100;
while (goal <= goalim) {
for (int i = 0; i < goal; i++) {
if (points > 50) {
goal = goalim + 1;
break;
}
points += i;
}
}