更多"有如下程序: Private Sub Form_Click( ) "的相关试题:
[单项选择]有如下程序: Private Sub Form_Click( ) Dim i As Integer, Sum As Integer sum=0 For i=2 To 10 If i Mod 2<>0 And i Mod 3=0 Then sum=sum+i End If Next i Print sum End Sub 程序运行后,单击窗体,输出结果为______。
A. 12
B. 30
C. 24
D. 18
[填空题]设有如下程序:
Private Sub Form_Click( )
Dim a As Integer,b As Intger
a=20:b=50
p1 a,b
p2 a,b
p3 a,b
Print"a=";a,"b=";b
End Sub
Sub p1(x As Integer,ByVal y As Integer)
x=x+10
y=y+20
End Sub
Sub p2(ByVal x As Integer,y As Integer)
x=x+10
y=y+20
End Sub
Sub p3(ByVal x As Integer,ByVal y As Integer)
x=x+10
y=y+20
End Sub
该程序运行后,单击窗体,则在窗体上显示的内容是:a= 【14】 和b= 【15】 。
[单项选择]阅读下列程序: Private Sub Form Click( ) Dim i As Integer, sum As Integer For i = 2 To 10 If i Mod 2 <> 0 Then Print i; Else sum = sum + i End If Next i Print sum End Sub 程序运行后,单击窗体,在窗体上的输出结果是
A. 3 5 7 9 30
B. 1 3 5 7 9
C. 2 4 6 8 20
D. 11 15 17 19 20
[单项选择]阅读程序:
Private Sub Form_Click( )
Dim num As Integer, digit As Integer
num = InputBox("输入数据")
Do While num <> 0
digit = num Mod 10
num = num / 10
Print digit;
Loop
End Sub
程序运行后,如果从键盘上输入12345,则输出结果为________。
A. 1 3 7 5 9
B. 5 4 3 2 1
C. 2 4 6 8 10
D. 1 2 3 4 5
[单项选择]有如下程序:
Private Sub Commandl_Click( )
Dim a As Integer
a=2
For i=1 To 3
Print Gad (a)
Next i
End Sub
Function Gad (a As Integer)
b=0
Static c
b=b + 1
c= c + 1
Gad= a + b + C
End Function
运行上面的程序后,单击命令按钮,输出结果为( )。
[单项选择]有如下程序:
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
程序运行后,输出的结果是( )。
[填空题]设有如下程序
Private Sub Form Click( )
Dim a As Integer, b As Integer
a=20: b=50
p1 a, b
p2 a, b
p3 a, b
Print "a="; a, "b="; b
End Sub
Sub p1(x As Integer, ByVal y As Integer)
x = x+10
y = Y+20
End Sub
Sub p2(ByVal x As Integer, y As Integer)
x = x+10
y = y+20
End Sub
Sub p3(ByVal x As Integer, ByVal y As Integer)
x = x+10
y = y+20
End Sub
该程序运行后,单击窗体,则在窗体上显示的内容是:a==______和b=______。
[单项选择]有如下程序:
Private Sub Form Click( )
Dim i As Integer,sum As Integer
sum=0
For i=2 To 10
If i Mod 2<>0 And i Mod 3=0 Then
sum=sum+i
End If
Next i
Print sum
End Sub
程序运行后,单击窗体,输出结果为
A. 12
B. 30
C. 24
D. 18
[单项选择]有如下程序: 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 0
B. 20 -1
C. 10 Tree
D. 10 False
[单项选择]有如下程序:
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 * #
D. 1 1 * #
[单项选择]有如下程序: Private Sub Commandl_Click( ) Dim a As Single Dim b As Single a=2:b=4 Call CS(a,b) End Sub Sub CS(x As Single,y As Single) t=X x=t/y y=t Mod y End Sub 程序运行后,单击命令按钮,a和b的值分别为
A. 0 0
B. 1 1
C. 0 2
D. 1 2
[单项选择]有如下程序: Private Sub Command1 Click( ) Dim a As Single Dim b As Single a=5:b=4 Call S(a,B) End Sub Sub S(x As Single,y As Single) t=x x=t/y y=t Mod y End Sub 在调用运行上述程序后,a和b的值分别为
A. 0 0
B. 1 1
C. 2 2
D. 1 2
[填空题]设有如下程序:
Private Sub Form_Click( )
Dim a As Integer,s As Integer
n=8
S=0
DO
S=S+n
n=n-1
Loop While n>0
Print S
End Sub
以上程序的功能是 【10】 。程序进行后,单击窗体,输出结果为 【11】 。