首页/ 题库 / [单选题]单击命令按钮时,下列程序代码的执行结果为的答案

单击命令按钮时,下列程序代码的执行结果为 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 m>n:m=m—n:Loop DO While m<n:n=n-m:Loop Loop My Func=m End Function

单选题
2022-01-13 22:17
A、2
B、4
C、6
D、8
查看答案

正确答案
C

试题解析
解析:根据Myfune的定义,当m与n不相等时执行D。循环,此时如果m大于n,则执行m=m-n的Do循环。据此,MyFune(24,18)的值应该为24减去18。

标签:
感兴趣题目
窗体上有一个命令按钮和一个列表框(Sorted属性为True),执行下列过程后的输出结果是( )。 Private Sub Command1_Click() List1.AddItem"China" List1.AddItem"Great" List1.AddItem"Is",1 List1.AddItem"!",3 Print List1.List(2) End Sub
在窗体上画两个标签和一个命令按钮,其名称分别为Label1、Label2和Command1,然后编写如下程序: Private Sub func(L As Label,ByVal a As Integer) L.Caption="1234" a=a*a End Sub Private Sub Form_Load() Label1.Caption="ABCD" Label2.Caption=10 End Sub Private Sub Command1_Click() a=Val(Label2.Caption) Call func(Label1,A)Label2.Caption=a End Sub 程序运行后,单击命令按钮,在两个标签Label1和Label2中显示的内容分别是: ______。
在窗体上画两个标签和一个命令按钮,其名称分别为Labell、Label2和Command1,然后编写如下程序: Private Sub func(L As Label,ByVal a As Integer) L.Caption="1234" a=a*a End Sub Private Sub Form_Load() Label1.Caption="ABCD" Label2.Caption=10 End Sub Private Sub Command1_Click() a=Val(Label2.Caption) Call func(Labell,A)Label2.Caption=a End Sub 程序运行后,单击命令按钮,在两个标签Label1和Label2中显示的内容分别是 ______。
有下列程序: Private Sub Command1_Click() X$="Nanchang" y$="Beijing" z$="Nanjing" z$=InStr(Left(x$,3)+Right(y$,4),z$) Print z$ End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是
下列代码运行后输出结果是( )。 Defstr C-F Private Sub Command1_Click() C$="123" D="456" Print C+D$ End Sub
下列代码运行后输出结果是 Defstr B-E Private Sub Command1_Click() B$="123" C="456" Print B+C$ End Sub
在窗体上添加一命令按钮,其名为Command1,然后编写代码如下: private Sub Command1_Click() Dim arr(5)As Integer,arr1(5)AS Integer n=3 For i=1 To 5 arr(i)=i arr1(n)=2*n+i Next Print arr1(n);art(n) End Sub 程序的运行结果为
在窗体上画一个命令按钮(其Name属性为Command1),然后编写如下代码: Private Sub Command1_Click() Dim Arr1(10)As Integer,arr2(10)As Integer n=3 For i=1 To 5 Arr1(i)=i arr2(n)=2*n+i Next i Print arr2(n);Arr1(n) End Sub 程序运行后,单击命令按钮,输出结果是 ______。
单击命令按钮时,下列程度段的执行结果为( )。 Private Sub Command1_Click() Dim a As Integer, b As Integer, c As Integer a=2:b=4:c=6 Call S1(a,B) Print "a="; a; "b="; b; "c="; c Call S2(a,B) Print "a ="; a; "b ="; b; "c="; c; End Sub Private Sub S1(x As Integer, y As Integer) Dim c As Integer x=2*x:y=y+2:c=x+y End Sub Sub S2(x As Integer, ByVal y As Integer) Dim e As Integer x=2*x:y=y+2:c=x+y End Sub
在窗体上画两个文本框(其名称分别为Text1和Text2)和一个命令按钮(其名称为 Commandl),然后编写如下两个事件过程: Private Sub Command1_Click() Text1.Text = "Computer Rank Examination" End Sub Private Sub Text1_Change() Text2.Text = UCase(Text1.Text) End Sub程序运行后,单击命令按钮,则在Text2文本框中显示的内容是______。
在窗体上画一个命令按钮,名称为Command1。程序运行后,如果单击命令按钮,则显示一个输入对话框,在该对话框中输入一个整数,并用这个整数作为实参调用函数过程F1。对下面程序说法正确的是() Private Sub Command1_Click() x=InputBox("请输入整数")a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1=0 Else F1=1 End If End Function
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Sum=0 For x=1 To 5 Call subl(x, s) Sum=Sum+s Next x Print Sum End Sub Private Sub subl(y, w) w=1 For i=1 To y w=w*i Next i End Sub 程序运行后。单击命令按钮,则窗体上显示的内容是______。
相关题目
设有如下通用过程: Public Sub Fun(a(),ByVal x As Integer) For i = 1 To 5 x = x + a(i) Next End Sub 在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮,然后编写如下的事件过程 Private Sub Command1_Click() Dim arr(5) As Variant For i = 1 To 5 arr(i) = i Next n = 10 Call Fun(arr(), n) Text1.Text = n End Sub 程序运行后,单击命令按钮,则在文本框中显示的内容是_____
在窗体上画一个命令按钮(其Name属性为Command1),然后编写如下代码: Option Base 1 Private Sub Command1_Click() Dim a s = 0 a = Array (1,2,3,4) j = 1 For i = 4 To 1 Step - 1 s = s + a (i) * j j = j * 10 Next i Print s End Sub 运行上面的程序,单击命令按钮,其输出结果是______
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a As Integer, s As Integer a = 8 a = 1 Do s = s + a a = a - 1 Loop While a <= 0 Print s; a End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是_____
在窗体上画1个命令按钮,并编写如下事件过程:Private Sub Command1_Click()For i=5 to 1 step -08Print Int(i);Next iEnd Sub运行程序,单击命令按钮,窗体上显示的内容为________。
在窗体中添加一个名称为Cmd的命令按钮,然后编写如下程序: Public x As integer Private Sub Cmd_Click() x=10 Call add1 Call add2 MsgBox x End Sub Private Sub add1 ( ) x=x+20 End Sub Private Sub add2 ( ) Dim x As integer x=x+40 End Snb 窗体打开运行后,单击命令按钮,则消息框的输出结果为( )。
下面程序的输出是______。Private Sub Command1_Click() Print 73End Sub
单击一次命令按钮之后,下列程序段的执行结果为( )。 Pubic Sub Proc(a()As Integer) Static i As Integer Do a(i)=a(i)+a(i+1) i=i+1 Loop While i<2 End Sub Private Sub Command1_Click() Dim m As Integer,i As Integer,x(10)As Integer For i=0 To 4:x(i)=i+1:Next i For i=1 To 2:CallProc(x()):Next i For i=0 To 4:Print x(i);Next i End Sub
单击命令按钮,下列程序的执行结果是 Private Sub Blck (x As Integer) x = x * 2 + l If x <6 Then Call Blck(x) End If x = x * 2 + 1 Print x; End Sub Private Sub Commandl_Click() Blck 2 End Sub
在窗体中添加一个命令按钮(其Name属性为Command1),然后编写如下代码: Pfivme Sub Command1_Click( ) score=Iht(Rnd*10)+70 Select Case score Case ls<60 a$=“F” Case 60 T069 a$=“D” Case 70 To 79 a$=“C” Case 80 To 89 a$=“B” Case Else a$=“A” End Select Print aS End Sub 程序运行后,单击命令按钮,输出结果是
有如下程序: Private Sub Command1_Click() as="A WORKER IS HERE" x = Len(a$) For i=1 To x - 1 b$ =Mid$(a$, i,3) If b$ ="WOR" Then S=S+ 1 Next Print S End Sub 单击命令按钮,程序运行结果为
有如下程序: Private Sub Commandl_Click( ) a$="A WORKER IS HERE" x=Len(a$) For i=1,To x-1 b$=Mid$(a$,i,3) If b$="WOR" Then S=S+1 Next Print S End Sub 单击命令按钮,程序运行结果为
有如下程序: Private Sub Command1_Click() a$="A WCIRKER IS HERE" x=Len(a$) For i=1 To x-1 b$=Mid$(a$,i,3) If b$="WOR"Then S=S+1 Next Print S End Sub 单击命令按钮,程序运行结果为
执行下列程序后,鼠标单击窗体,输出结果为 Private Sub Form_Click() Print"Click": End Sub Private Sub Form_MouseDown(Button As Integer,Shift_As Integer,X As Single,Y As Single) Print"Donw" End Sub Private Sub Form_MouseUp(Button As Integer,Shift_As Integer,X As Single,Y As Single) Print"Up" End Sub
执行下列程序后,鼠标单击窗体,输出结果为。 Private Sub Form_Click() Print“Click”; End Sub Private Sub Form_MouseDown(Button As Integer,Shift_ As Integer,X As Single,Y As Single) Print “Donw” End Sub Private Sub Form_MouseUp(Button As Integer,Shift_ As Integer,X As Single,Y As Single) Print“Up” 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 m>n:m=m—n:Loop DO While m<n:n=n-m:Loop Loop My Func=m End Function
在窗体上画一个名称为Connand1的命令按钮,然后编写如下程序: Private Sub Command1_Click() Dim i As Integer, j As Integer Dim a(10, 10) As Integer For i = 1 To 3 For j = 1 To 3 a(i, j) = (i - 1) * 3 + j Print a(i, j); Next j Print Next i End Sub程序运行后,单击命令按钮,窗体上显示的是______。
在窗体上画一个名称为Commandl的命令按钮,然后编写如下程序: Private Sub Command1_Click() Dim i As Integer,j As Integer Dim a(10, 10)As Integer For i=1 To 3 For i=1 To 3 a(i,j)=(i-1) *3+j Print a(i,j); Next i Print Next i End Sub 程序运行后,单击命令按钮,窗体上显示的是
在窗体上画一个命令按钮,名称为Command1,然后编写如下程序: Private Sub Command1_Click() For i = 1 To 2 For j = 1 To i Print String(i, "Hello") Next j Print Next i End Sub
单击命令按钮时,下列程序的执行结果是 Private Sub Command1_Click( ) Dim a As Integer,b As Integer,c As Integer a=3 b=4 C=5 Print SecProc(c,b,A)End Sub Function Fir Proc(x As Integer,y As Integer,z As Integer) Fir Proc=2*x+y+3*z End Function Function SecProc(x As Integer,y As Integer,z As Integer) SecProc=FirProc(z,x,y)+x End Function
单击命令按钮时,下列程序的执行结果是 Private Sub Book(x As Integer) x=x * 2 + l If x<6 Then Call Book(x) End If X=X * 2 + 1 Print x; End Sub Private Sub Command2_Click() Book2 End Sub
广告位招租WX:84302438

免费的网站请分享给朋友吧