有如下的程序片段,该程序片段的执行完后,共执行循环______次。 Private Sub command1_ Click() total =0 Counter = 1 do Print Counter total = total + Counter Pr

admin2010-09-11  22

问题 有如下的程序片段,该程序片段的执行完后,共执行循环______次。
Private Sub command1_ Click()
total =0
Counter = 1
do
Print Counter
total = total + Counter
Print total, "111"
Counter = Counter + 1
if total >= 10 then
exit do
End if
Loop while Counter <= 10
End Sub

选项

答案A

解析 本题的重点是判断循环非正常退出的问题。该段程序有“total>10”和“Counter<=10”两个条件,只要其中一个条件先成守,循环就退出。total的计算过程为“1+2+3+4=10”,Counter的计算过程为“1+1+1+1=4”。
转载请注明原文地址:https://kaotiyun.com/show/EJmp777K
0

最新回复(0)