首页/ 题库 / [单选题]有下列程序: Private Sub C的答案

有下列程序: Private Sub Command1_Click() X$="Nanchang" y$="Beijing" z$="Nanjing" z$=InStr(Left(x$,3)+Right(y$,4),z$) Print z$ End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是

单选题
2022-05-21 07:09
B、1
C、3
D、4
查看答案

正确答案
B

试题解析
解析:Left(x$,3)的返回值为“Nan”,Right(y$,4)的返回值为“jing”,InStr("Nanjing",z$)的返回值为1。

标签:
感兴趣题目
有如下函数过程: Function Fun(By Val x As Ingeger,ByVal y As Integer)As Integer Do While…Y<>0 reminder=x Mod Y x=y y=reminder Loop Fun=X End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100:b=25 x=Fun(a,b) Print x End Sub
有如下的程序段,该程序段的执行完后,共执行循环的次数是 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 Sub
有下列程序: Private Sub Command1_Click() X$="Nanchang" y$="Beijing" z$="Nanjing" z$=InStr(Left(x$,3)+Right(y$,4),z$) Print z$ End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是
Private Sub Command1_Click() a=Val(InputBox("请输入a的值=")) b=Val(InputBox("请输入a的值=")) x=a+b Ifa>b Then x=a-b End If Print x End Sub 若运行时从键盘输入a和b分别为3和4,则程序输出的结果为()
下列代码运行后输出结果是( )。 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
单击命令按钮时,下列程度段的执行结果为( )。 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
设有如下程序: Private Sub Command1_Click() Dim a Dim I As Integer a=Array(1,2,3,4,5,6,7,8,9) For I=0 To 3 Print a(5-I); Next I End Sub 程序运行后,单击窗体,则在窗体上显示的是()
在窗体上画一个名称为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 程序运行后。单击命令按钮,则窗体上显示的内容是______。
运行以下程序后,输出的图形是 Private Sub Command1_Click( ) Line(500,500)-(1000,500) Line(750,300)-(750,700) End Sub
运行以下程序后,输出的图形是 Private Sub Command1_Click() Line(500,500)-(1000,500) Line(750,300)-(750,700) End Sub
下列程序段运行后输出的结果是()。 Private Sub Form_Click Dim X#, Y# X = 5: Y = 6 Print X + Y = 11 End Sub
相关题目
有如下一个Sub过程: Sub mlt(ParamArray numbers()) n=1 For Each x In numbers n=n*x Next x Print n End Sub 在一个事件过程中如下调用该Sub过程: Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a=1 b=2 c=3 d=4 mlt a,b,c,d End Sub 该程序的运行结果为( )。
下面程序运行后的输出结果是 Private Sub Command1_Click() For j=1 To 10 If j Mod 3<>0 Then a=a+j3 Next Print a End 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 窗体打开运行后,单击命令按钮,则消息框的输出结果为( )。
执行下面的程序段,x的值为 Private Sub Command1_Click( ) For i=1 To 5 a=a+i Next i x=Val(i) MsgBox x End Sub
若将子过程SUB中的PRIVATE X改为PRIVATE Y,则X的输出结果为 ______。
在以下事件中,Private表示 Private Sub sub1(x As Integer,y As Integer) ...End Sub
下面程序的输出是______。Private Sub Command1_Click() Print 73End 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
下面程序的运行结果是 Private Sub Command1_Click() x=1:y=1 For i=1 To 3 x=x+y:y=y+x Next i:print x,y 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 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 Click MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) Print”Visual Basic Program” End Sub
若看到程序中有以下事件过程,则可以肯定的是,当程序运行时Private Sub Click_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)Print”VB Program”End Sub
设有如下程序 Private Sub Command1 Click( ) x=10:Y=0 For i=l To 5 Do x=x-2 y=y+2 Loop Until y>j Or x<-l Nex1 End Sub 运行程序,其中Do循环执行的次数是( )。
下列程序段运行后窗体上输出结果为( )。 Private Sub Command1_Click() a=5: b=4: c=3: d=2 x=3>2*b Or a=c And b<>c Or c>d Print x End Sub
单击命令按钮时,下列程序的执行结果是 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
有以下函数过程: Function Gys (ByVal x As Integer, ByVal y As Integer) As Integer Do While y<>0 Reminder = x Mod y x = y y= Reminder Loop Gys=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a = 50 b = 10 x=Gys (a,B)Print x End Sub
有如下函数过程: Function Fun (By Val x As Ingeger, ByVal y As Integer)As Integer Do While…y<>0 reminder=x Mod y x=y y=reminder Loop Fun=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100:b=25 x=Fun(a,b)Print x End Sub
广告位招租WX:84302438

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