网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下列程序输出结果为: Sub test() m = 1 n = 1 i = 0 Do While n < 5 m = m + n n = n + m i = i + 1 Loop Debug.Print n End Sub

A.8

B.11

C.5

D.34


参考答案和解析
C 解析: main() {int I,j.m=0.n=0; for(I=0;I<2;I++) for(j=0;j<2;j++) if(j>=i)m=1;n++;/*本行语句虽然包含'n++',但不包括在任何循环体内*/ printf('%d\\n',n): }
更多 “下列程序输出结果为: Sub test() m = 1 n = 1 i = 0 Do While n < 5 m = m + n n = n + m i = i + 1 Loop Debug.Print n End SubA.8B.11C.5D.34” 相关考题
考题 单击命令按钮时,下列程序的运行结果为 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

考题 (25)下列程序的运行结果是 。 Private Function myfun(m,n) Do While mn Do While mn:m=m-n:Loop Do While nm:n=n-m:Loop Loop myfun=m End Function Private Sub Command1_Click() Print myfun(9,8) End SubA.2 B.1 C.4 D.3

考题 在窗体中添加—个名称为Command1的命令按钮,然后编写如下事件代码: Private Sub Command1_Click() MsgBox f(24,18) End Sub Public Function f(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 f=m End Function 窗体打开并运行后,单击命令按扭,则消息框的输出结果是______。A.2B.4C.6D.8

考题 有如下事件过程: Private Sub Command1_Click( ) Dim m AS Integer,n AS Integer m=2:n=1 Print "m=";m;"n=";n Call TOD(m,n) Print "m=";m;"n=";n End Sub Sub TOD(x,y) x=x^2 y=y^3 End Sub 程序运行后,输出的结果为A.m=2,n=1 m=1,n=2B.m=2,n=1 m=4,n=1C.m=1,n=2 m=1,n=4D.m=1,n=2 m=2,n=4

考题 下列程序的运行结果是( )。 Private Function myfun(m,n) Do while mn Do While mn:m=m-n:Loop Do Wllile nm:n=n-m:Loop Loop myfun=m End Function Private Sub Command1_Click( ) print myfun(9,8) End SubA.2B.1C.4D.3

考题 以下能够正确计算n!的程序是A.Private Sub Command1_Chck( ) n=5:x=1 Do x=x*i i=i+1 Loop While i<n Print x End SubB.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<n Print x End SubC.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<=n Print x End SubD.Private Sub Command1_Click( ) n=5:x=1:i=l Dox=x*i i=i+1 Loop While i>n Print x End Sub

考题 阅读下面的程序: Private Sub Form_Click() Dim m,n As Integer m=InputBox("请输入M的值") m=Val(m) m1=m n=InputBox("请输入N的值") n=Val(n) n1=n Do While n<>0 remin=m Mod n m=n n=remin Loop Print m1,n1,m End Sub 程序运行后,单击窗体,在对话框中分别输入16和24,则程序在窗体上的输出结果为A.16 24 4B.16 24 8C.24 16 6D.24 16 8

考题 有如下程序: Private Sub Commandl_Click( ) Dim i As Integer For i=1 To 2 DS Next i End Sub Sub DS( ) Dim x As Integer,m As String Static y,n X=X + 1 y=y + 1 m=m "*”:n=n"#" Print x,y,m,n End Sub 程序运行后,输出的结果是A.1 1 * #B.1 1 * #C.1 1 * # 1 1 * # 1 2 * #D.1 1 * # 1 1 * ## 1 2 * ##

考题 以下能够正确计算n!的程序是A.Private Sub Command1 Click() n=5:x=1 Do x=x * I I=I + 1 Loop While I < n Print x End SubB.Private Sub Command1_Click() n=5:X=1:I=1 Do X=X*I I=I + 1 Loop While I <n Print x End SubC.Private Sub Command1_Click() n=5:X=1:I=1 Do X=X * I I=I + 1 Loop While I<=n Print X End SubD.Private Sub Command1_Click() n=5:X=1:I=1 Do x=x * I I=I + 1 Loop While I>n Print X End Sub

考题 单击命令按钮时,下列程序代码的运行结果为 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 Whle m<n:n=n-m:Loop Loop MyFunc=m End FunctionA.0B.2C.4D.6

考题 以下能够正确计算n! 的程序是( )。A.Private Sub Command1_Click( ) n=5:x=l Do x=x*i i=i+1 Loop While i < n Print x End SubB.Private Sub Command1_Click( ) n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i < n Print x End SubC.Private Sub Command1_Cliek( ) n:5:x=1:i=1 Do x=x* i i:i+1 Loop While i < = n Print x End SubD.Private Sub Command1_Cliek( ) n=5:x:1:i=1 Do x=x*i i=j+1 Loop While i > n Print x End Sub

考题 设有如下程序: Dim a()As Integer Private Sub Command1_Click() n=-5:m=6 ReDim a(n To m) For i=LBound(a,1)To UBound(a,1) a(i)=i Next i Print a(LBound(a,1));a(UBound(a,1)) End Sub 程序运行后,单击命令按钮,则输出结果是 ______。A.0 0B.-5 0C.-5 6D.0 6

考题 单击命令按钮时,下列程序的运行结果为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

考题 单击命令按钮时,下列程序代码的运行结果为 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

考题 以下能够正确计算n!的程序是A.Privas Sub Command1_Click() n=5:x=1 Do x=x*i i=i+1 Loop While i<n Print x End SubB.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i<n Print x End SubC.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop while i<=n Print x End SubD.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i>n Print x End Sub

考题 有如下事件过程: Private Sub Commaild1_Click( ) Dim i As Integer For i =1 To 2 DC Next i End Sub Sub DC( ) Dim x As Integer,m As String Static y,n x=x + 1 y=y + 1 m=m"*":n=n "#" Print x,y,m,n End Sub 程序运行后,输出的结果是A.1 1 * # 1 1 * #B.1 1 * # 1 2 * #C.1 1 * # 1 1 * ##D.1 1 * # 1 2 * ##

考题 单击命令按钮后,下列程序代码的执行结果是______。Public Sub fun (a As Integer, b As Integer, c As Integer)Doa=b+ cn=n+1Loop While n > 3End SubPrivate Sub command1_ click()Dim m As Integer, n As Integer, i As IntegerFor i = 0 To 2: m = n + 1: Next iFor i = 1 To 2: Call fun (m, n, i): Next iFor i = 0 To 3Print m;Next iEnd Sub

考题 下面程序的运行结果是 ______ 。程序的功能是 _______ 。Public Function myfun(m,n)Do while m>nDo while m>n:m=m-n:LoopDo While n>m:n=n-m:LoopLoopMyfun=mEnd FunctionPrivate Sub Command1_Click()Print myfun(15,15)End Sub

考题 下列程序段的运行结果是( )。 Sub sele() Dim n As Integer i=21: n=3 Do While i > n i=i-n Loop Print i End SubA.2B.4C.5D.3

考题 单击命令按钮时,下列程序的运行结果为 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

考题 单击命令按钮时,下列程序代码的执行结果为______ 。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

考题 下列程序的运行结果是( )。 Private Function myfun(m,n) Do While m>n Do While m>n:m=m-n:Loop Do While n>m:n=n-m:Loop Loop myfun=m End Function Private Sub Command1_Click() Print myfun(9,8) End SubA.2B.1C.4D.3

考题 下列程序的运行结果是( )。 Private Function myfun(m, n) Do While m > n Do While m>n:m=m-n:Loop Do while n>m:n=n-m:Loop Loop myfun=m End Function Private Sub Command1_Click() Print myfun(9, 8) End SubA.2B.1C.4D.3

考题 以下能够正确计算n!的程序是______。A.Private Sub Commeadl_Click() n=5: x=1 Do x=x*i i=i+1 Loop While i<n Print x End SubB.Private Sub Command1_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop While i<n Print x End SubC.Private Sub Command1_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop Whilei<=n Print x End SubD.Private Sub Commsndl_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop While i>n Print x End Sub

考题 以下能够正确计算n!的程序是( )。A.Pfivate Sub Commgld1_LClick() n=5:x=1 Do x=x*1 i=i+1 Loop Whilei<nB.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*1 i=i+1 Loop Whilei<n Print x End SubC.Pfivate Sub Command1_ C1ick() n=5:x=1:i=1 Do X=X*1 i=i+1 Loop While i<=nD.Private Sub Command1_C1ick() n=5:x=1:i=1 Do X=X*1 i=i+1 Loop While i>n Print x End Sub

考题 单击命令按钮时,下列程序的运行结果为 Private Sub Command1_Click( ) Print MyFund(20,18) End Sub Public Function MyFund(m As Integer,n As Integer)As Integer Do While m◇n Do While mn:m=m-n:Loop Do While m<n:n=n-m:Loop Loop MyFund=m End FunctionA.0B.2C.4D.6

考题 以下能够正确计算n!的程序是( )。A.Private Sub Commandl_C1ick()B.hiVate Sub Commandl_C1ick() n=5:x=1 n=5:x=1:i=1 DO DO X=x*1 X=X*1 i=i+1 i=i+1 Loop while i<n Loop While<n Print x Ptinte x End Sub End SubC.Private Sub Commandl_Click ()D.Pdvate Sub Commandl C1ick() n=5:X=1:i=1 n=5=:x=1:i=1 DO DO X=X*1 X=X*1 i=i+1 i=i+1 Loop While i>n Print x Print x End Sub End Sub

考题 单击命令按钮时,下列程序代码的执行结果为 Private Sub Command1_Click( ) Print MyFunc(24,18) End Sub Public Function MyFunc(m As Integer,n As Integer)As Integer Do While m ◇ n Do While mn:m=m—n:Loop DO While m<n:n=n-m:Loop Loop My Func=m End FunctionA.2B.4C.6D.8