有如下的程序:
PrivateSubCommand1_Click()
DimxAsInteger,yAsInteger
a=8
b=3
Calltest(6,a,b+1)
Print"主程序";6;a;b
EndSub
Subtest(xAsInteger,ByValyAsInteger,ByValzAsInteger)
Print"子程序";x;y;z
x=2
y=4
z=3
EndSub
当单击Command1后,运行程序显示的结果是( )
A.子程序643主程序684
B.主程序643子程序684
C.主程序684子程序683
D.子程序684主程序643
第1题:
单击命令按钮时,下列程序的执行结果为 Private Sub Command1_Click( ) Dim x As Integer, y As Integer x=12:y=32 Call PCS(x, y) Print x; y End Sub Public Sub PCS( ByVal n As Integer, ByVal m As Integer) n = n Mod 10 m=m Mod 10 End Sub
A.12 32
B.2 32
C.2 3
D.12 3
第2题:
设有Function过程:
Private Function f(a As Integer, b As Integer) As Integer
a = a * a:
b = b * b
f = CInt(Sqr(a - b))
End Function
则如下程序段的运行结果是( )。
Private Sub Command1_Click()
Dim X As Integer, Y As Integer
X = 5: Y = 4
a = f(X, Y)
Print a
End Sub
A. 5
B. 4
C. 3
D. 9
第3题:
窗体上有一个名为Commandl的命令按钮,并有如下程序:
Private Sub Command 1_Click()
Dim a As Integer, b As Integer
a=8
b=12
Print Fun(a, b);a; b
End Sub
Private Function Fun(ByVal a As Integer, b As Integer)As Integer
a=a Mod 5
b=b、5
Fun=a
End Function
程序运行时,单击命令按钮,则输出结果是
A)3 3 2
B)3 8 2
C)8 8 12
D)3 8 12
第4题:
单击命令按钮时,下列程序的执行结果为 Private Sub Command1_Click( ) Dim x As Integer,y As Integer x=12:y=32 Call Proc(x,y) Print x;y End Sub Public Sub Proc(n As Integer,ByVal m As Integer) n=n Mod 10 m=m Mod 10 End Sub
A.12 32
B.2 32
C.2 3
D.12 3
第5题:
若有如下程序: main() { int a=1,b=1; for(;a<=10;a++) { if(b>=9) break; if(b%3==1) {b+=3;continue;} b++; } printf("%d,%d",b,a); } 则程序运行后的输出结果是( )。
A.10,4
B.7,3
C.10,3
D.11,3