有如下的程序段,该程序段执行完后,共执行的循环次数是  total=0  Counter=1  Do  Print Counter  total=total * Counter + 1  Print total  Counter=Counter +1  I

admin2009-01-15  40

问题 有如下的程序段,该程序段执行完后,共执行的循环次数是  total=0  Counter=1  Do  Print Counter  total=total * Counter + 1  Print total  Counter=Counter +1  If total > 10 Then     Exit Do   End If  Loop While Counter<=10

选项 A、4
B、10
C、15
D、20

答案1

解析 Do…Loop While语句
本题中Counter为计数器,当Counter=4时,total=41>10,跳出循环,共执行4次循环。注意:Do…Loop While结构和条件语句或多分支结构的嵌套结构。
转载请注明原文地址:https://jikaoti.com/ti/3080FFFM
0

最新回复(0)