下列程序段的执行结果为()。 a=0:b=1 Do a=a+b b=b+1 Loop While a<10 Print a;bA.10 5B.a bC.0 1D.10 30
下列程序段的执行结果为()。 a=0:b=1 Do a=a+b b=b+1 Loop While a<10 Print a;b
A.10 5
B.a b
C.0 1
D.10 30
参考答案和解析
A
相关考题:
下列各种形式的循环中,输出“*”的个数最少的循环是A.a=5:b=8 Do Print "*" a=a+1 Loop While a<bB.a=5:b=8 Do Print "*" a=a+1 Loop Until a<bC.a=5:b=8 Do Until a-b Print "*" b=b+1 LoopD.a=5:b=8 Do Until a>b Print "*" a=a+1 Loop
在VB程序中有以下程序段,语句Print "VB"的执行次数是( )i=1Do While i 在VB程序中有以下程序段,语句Print "VB"的执行次数是( )i=1Do While iPrint "VB"LoopA.0B.1C.2D.无数
单击命令按钮时,下列程序的运行结果为 Private Sub Command1_Click() Print Fun(23,18) End Sub Public Function Fun(m As Integer,n As Integer)As Integer Do While m<>n Do While m>n:m=m-n:Loop Do While m<n:n=n-m:Loop Loop Fun=m End FunctionA.0B.1C.3D.5
下列各种形式的循环中,输出"*"的个数最少的循环是A.a=5:b=8 Do Print"*" a=a+l Loop While a<bB.a=5:b=8 Do Print"*" a=a+l Loop Until a<bC.a=5:b=8 Do Until a-b Print"*" b=b+1 LoopD.a=5:b=8 Do Until a>b Print"*"a=a+1 Loop
有如下程序: Private Sub Form Click() Dim Check,Counter Check=True Counter=0 Do Do While Counter<20 Counter=Counter+1 If Counter=10 Then Check=False Exit Do End If Loop Loop Until Check=False Print Counter,Check End Sub 程序运行后,单击窗体,输出结果为A.15 0B.20 -1C.10 TreeD.10 False
阅读下面的程序: Private Sub Form_Click() Dim Check, Counter Check=True Counter=0 Do Do While Counter < 20 Counter=Counter + 1 If Counter=10 Then Check = False Exit Do End If Loop Loop Until Check = False Print Counter, Check End Sub 程序运行后,单击窗体,输出的结果为A.15 0B.20 -1C.10 TrueD.10 False
有如下的程序段,该程序段执行完后,共执行的循环次数是 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<=10A.4B.10C.15D.20
单击命令按钮时,下列程序的运行结果为Private Sub Command1_Click( ) Print MyBM(23,18)End SubPublic Function MyBM(m As Integer,n As Integer)As Integer Do While m n Do While m > n:m=m - n:Loop Do While m < n:n=n - m:Loop Loop MyBM=mEnd FunctionA.0B.1C.3D.5
有如下程序段,该程序段执行完后,执行循环的次数是 total=0 Counter=1 Do Print Counter total=total + Counter Print total Counter=Counter+1 If total>10 Then Exit Do End If Loop While Counter <=10A.5B.10C.15D.20
下列程序段的执行结果为______。 x = 0: y = 1 z = 1: n = 0 Do x = x + y + z n = n + 1 Loop While x < 10 Print x; nA.10 5B.x nC.9 5D.10 6
单击命令按钮时,下列程序代码的运行结果为 Private Sub Command1_Click() print MyFunc(20,18) End Sub Public Function MyFunc (m As Integer,n As Integer)As Integer Do While m n Do While m > n:m=m - n:Loop Do While m < n:n=n - m:Loop Loop MyFunc=m End FunCtionA.0B.2C.4D.6
有如下的程序段,该程序段的执行完后,共执行循环的次数是 Private Sub Command1_Click() total=0 Counter=l Do Print Counter total=total+Counter Print total Counter=Counter+1 If total>=10 Then Exit Do End If Loop While Counter<=10 End SubA.5B.10C.12D.20
单击命令按钮时,下列程序的运行结果为 Private Sub Command1_Click( ) Print Fun(23, 18) End Sub Public Function Fun(m As Integer, n As Integer) As Integer Do Whilem <> n Do While m > n : m--m - n: Loop Do While m < n : n=n - m: Loop Loop Fun =m End FunctionA.0B.1C.3D.5
下列程序段的执行结果为______ 。 N=0 J=1 Do Until N > 2 N=N+1 J=J+N* (N+ 1) Loop Print N; JA. 0 1B.3 7C.3 21D.3 13
单击命令按钮时,下列程序代码的执行结果为______ 。Public Function MyFune(m As Integer,n As Integer) As Integer Do While m<>n Do While m>n m=m-n Loop Do While m<n n=n -m Loop Loop MyFunc=mEnd FunctionPrivate Sub Command1_Click() Print MyFunc(24, 18)End SubA. 2B.4C.6D.8
下列程序执行后,变量S的值为______ 。 Dim s As Long,X As Integer s=0 X=1 Do While x<10 s= s+ x x=x+2 Loop Print sA. 10B.25C.50D.100
下列各种形式的循环中,输出“*”的个数最少的循环是( )。A.a=5:b=8 Do Print"*" a=a+1 Loop While a<bB.a=5:b=8 Do Print"*" a=a+1 Loop Until a<bC.a=5:b=8 Do Until a-b print"*" b=b+1 LoopD.a=5:b=8 DoUntil a>b Print"*" a=a+1 Loop
有如下程序段,该程序段执行完后,共执行循环的次数是 Private Sub Command1_Click( ) Tota1=0 Counter=1 Do Print Counter Tota1=tota1+Counter Print total Counter=Counter+1 If total=10 Then Exit Do End lf Loop While Counter<=10 End SubA.5B.10C.12D.20