
please wait
|
|
if(x==1)...
if x does indeed x = 1, then the condition is evaluated to true (because it is true that x = 1). however if x ='s lets say 5, then it would be false (because it is false that x == 5). so the while true loop basically means that the condition is evaluated to true and will be always executed
while (true)
means that the loop will iterate forever, unless some command inside the loop forces the loop to end. In this case, the break;
on line 11 will force the loop to end.