更多"程序代码如下,当单击窗体上的Command1控件时,窗体上显示的结果是"的相关试题:
[单项选择]程序代码如下,当单击窗体上的Command1控件时,窗体上输出的结果是( )。
Private Sub Command1_Click( )
Dim Y As Integer,I As Integer
Dim A(7)As Integer
Y=18:I=0
Do
A(I)=Y Mod 2
I=I+1
Y=Y/2
Loop Until Y<1
For j=I-1 To 0 Step-1
Print A(j);
Next j
End Sub
A. 1 0 0 0
B. 1 0 0 1 0
C. 0 0 1 1 0
D. 1 0 1 0 0
[单项选择]程序代码如下,当单击窗体上的Command1控件时,窗体上显示的结果是( )。
Private Sub Command1_Click( )
Dim i As Integer,k As Integer
Dim a(9) As Integer,p(2)As Integer
k=5
For i=0 To 9
a(i)=i
Next i
For i=0 To 2
p(i)=a(i*(i+1))
Next i
For i=0 To 2
k=k+p(i)*2
Next i
Print k
End Sub
A. 20
B. 21
C. 22
D. 23
[单项选择]程序代码如下,当单击窗体上的Command1控件时,在窗体上输出的结果是( )。 Private Sub Command1_Click( ) Dim aa(3,3)As Integer Dim i As Integer,j As Integer Dim s As Integer For i=0 To 3 For j=0 To 3 aa(i,j)=i*4+j+1 Next j Next i For i=0 To 3 s=s+aa(i,1) Next i Print s End Sub
A. 32
B. 28
C. 30
D. 36
[单项选择]程序代码如下,当单击窗体上的Command1控件时,窗体上显示的结果是( )。
Option Base 1
Private Sub Command1_Click( )
Dim i As Integer
Dim x(3,3)As Integer
For i=1 To 3
For j=1 To 3
x(i,j)=(i-1)*3+j
Next j
Next i
For i=1 To 3
Print x(i,4-i);
Next i
End Sub
A. 1 5 9
B. 1 4 7
C. 3 5 7
D. 3 6 9
[填空题]单击窗体上的命令按钮Command1, 【10】
Private Sub Command1_Click( )
a= "10"
b=20
c=Val(a) +b
Print c
End Sub
[单项选择]单击窗体上Command1命令按钮时,执行如下事件过程: Private Sub Command1_Click( ) a$= "software and hardware" b$= Right(a$, 8) c$= Mtd(b$ 1, 8) Msgbox c$ End sub则在弹出的信息框的标题栏中显示的信息是( )。
A. software and hardware
B. software
C. hardware
D. and
[填空题]窗体上命令按钮Command1的事件过程如下:
Private Sub Command1_Click( )
Dim total As Integer
total=s(1)+s(2)
Print total
End Sub
Private Function s(m As Integer)As Integer
Static x As Integer
For i=1 To m
x=x+1
Next i
S=x
End Function
运行程序,第3次单击命令按钮Command1时,输出结果为______。
[单项选择]在窗体上画一个命令按钮,名称为Command1。单击命令按钮时,执行如下事件过程:
Private Sub Command1_Click( )
a$="software and hardware"
b$=Right(a$,8)
c$=Mid(a$,1,8)
MsgBox a$,,b$,c$,1
End Sub
则在弹出的信息框的标题栏中显示的信息是( )。
A. software and hardware
B. software
C. hardware
D. 1
[单项选择]在窗体上有一个命令按钮Command1,编写如下程序:
Private Sub Command1_Click( )
Print pp1(3, 7)
End Sub
Public Function pp1(x As Single, n As Integer) As Single
If n = 0 Then
pp1 = 1
Else
If n Mod 2=1 Then
pp1=x*x+n
Else
pp1=x*x-n
End If
End If
End Function
程序运行后,单击该命令按钮,屏幕上显示的是( )。
A. 2
B. 1
C. 0
D. 16