If x is an int where x = 0, what will x be after the following loop terminates?
while (x < 100)
x *= 2;
a) 64
b) 100
c) 128
d) None of the above, this is an infinite loop
Answer: e. Explanation: Since x starts at 0, x *= 2; results in 0 * 2, or x = 0. Since x remains 0, (x < 100) remains true, and the loop repeats. x continues to be 0 and so the condition never changes to false, and thus the loop never terminates.