更多"阅读程序: Function Fun( a As Integer)"的相关试题:
[单项选择]阅读程序:
Function Fun( a As Integer)
Static c
b=0:b=b+2:c=c+2
F=a*b*c
End Function
Private Sub Commandl _ Click( )
Dim a As Integer
a=2
For i = 1 To 2
Print Fun (
A. ;
[单项选择]阅读程序:
Function Fun(a As Integer)
Static C
b=0:b=b+2:c=c+2
Fun=a*b*c
End Function
Private Sub Command1_Click( )
Dim a As Integer
a=2
For i=1 To 2
Print Fun(A):
Next
End Sub
运行上面的程序,单击命令按钮,输出结果为( )。
A. 8 16
B. 9 18
C. 10 20
D. 7 14
[单项选择]阅读程序: Function F(a As Integer) b=0 Static c b=b+1 c=c+1 F=a+b+c End Function Private Sub Command1_Click( ) Dim a As Integer a=2 For i=1 To 3 Print F(a) Next i End Sub 运行上面的程序,单击命令按钮,输出结果为 ______。
A. 4 4 4
B. 4 5 6
C. 4 6 8
D. 4 7 9
[单项选择]有如下一个函数过程:
Function Fun(a As Integer)
Static c
b=0:b=b+1:c=c+1
Fun=a+b+c
End Function
在窗体上添加一个命令按钮,事件过程如下:
Private Sub Command1_Click( )
Dim a As Integer
a=2
For i=1 To 3
Print Fun(
A. ;
[单项选择]阅读程序:
Function fac(ByVal n As Integer)As Integer
Dim temp As Integer
temp=1
For i%=1 To n
temp=temp*i%
Next i%
fac=temp
End Function
Private Sub Form_Click( )
Dim nsum As Integer
nsum=1
For i%=2 To 4
nsum=nsum+fac(i%)
Next i%
Print nsum
End Sub
程序运行后,单击窗体,输出结果是( )。
A. 35
B. 31
C. 33
D. 37
[单项选择]有如下一个函数过程:
Function Fun(a As Integer)
Stcitic C
b=0:b=b+1:c=c+1
Fu n=a+b+c
End Function
在窗体上添加一个命令按钮,事件过程如下:
Private Sub Command1_Click( )
Dim a As Integer
a=2
For i=1 To 3
Print Fun(A):
Next
End Sub
运行该程序,单击命令按钮,输出结果是( )。
A. 4 4 4
B. 4 5 6
C. 6 7 8
D. 4 7 9
[单项选择]阅读程序: Function F(a As Integer) b=0 Static c b=b+1 c=c+1 f=a+ b+ c End Function Private Sub Command1_Click( ) Dim S As Integer a=2 For i=1 To 3 Print P(A) Next i End Sub运行上面的程序,单击命令拄钮,输出结果为______ 。
A. 4 4 4
B. 4 5 6
C. 4 6 8
D. 4 7 9
[单项选择]假定有以下通用过程:
Function Fun(n As Integer)As Integer
x=n * n
Fun=x - 11
End Function
在窗体上画一个命令按钮,其名称为Command1,然后编写如下事件过程:
Private Sub Command1_Click( )
Dim i As Integer
For i = 1 To 2
y = Fun(i)
Print y;
Next i
End Sub
程序运行后,单击命令按钮,在窗体上显示的内容是( )。
A. 1 3
B. 10 8
C. -10 -7
D. 0 5
[填空题]设有以下函数过程:
Function fun(m As Integer) As Integer Dim k As Integer, sum As Integer sum = 0
For k = m To 1 Step -2
sum = sum + k
Next k
fun = sum
End Function
若在程序中用语句s=fun(10)调用此函数,则s的值为 _________。
[填空题]
设有以下函数过程:
Function fun(m As Integer)As Integer
Dim k As Integer, sum As Integer
sum=0
For k=m To 1 Step-2
sum=sum+k
Next k
fun=stlm
End Function
若在程序中用语句s=fun(10)调用此函数,则s的值为()。