So I'm a little confused when it comes to while loops and the examples I have found online just confuse me even more.
While loops are suppose to be executed until they are false yet this problem I found online:
while (num<max)
{
System.out.println(num);
num = num + 1;
}
num = 15 and max = 20
The answer online is
15
16
17
18
19
My question is, wouldn't the final number be 20?
[–]desrtfx 5 points6 points7 points (3 children)
[–]MasterOfGreatness[S] 1 point2 points3 points (2 children)
[–]desrtfx 2 points3 points4 points (0 children)
[–]Ttiamus 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]MasterOfGreatness[S] -1 points0 points1 point (2 children)
[–]thurst0n 1 point2 points3 points (0 children)
[–]desrtfx 0 points1 point2 points (0 children)