Given:

What is the result?

A.

ii = 1
ii = 2

B. Compilation fails
C. The program prints nothing
D. The program goes into an infinite loop with no output
E. The program goes to an infinite loop outputting:

ii = 1
ii = 1

題解

此題的while迴圈用法錯誤,會造成編譯錯誤。如果要修正,可以改寫成:

或是使用for迴圈改寫成: