public static void main(String[] args) {
result = 0;
for (num = 1; num <= 20; num++) {
if (result >= 100) {
break;
} else {
result += num;
}
}
System.out.println("The sum of the number 1-20 is " + result + ".\nThe last number have be add is " + num);
}
}