单选题 VB
题号 #2273145

阅读程序:
Function fac(ByVal 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 T0 4
    nsum=nsum+fac(i%)
  Next i%
  Print nsum
End Sub
程序运行后,单击窗体,输出结果是(  )。

进入在线模考

参考答案

C

答案解析

C。【解析】本题考查的是函数的调用,Function函数的意义是某个数的阶乘,所以通过计算结果为4 !+3 !+2!+1 !=33

你可能感兴趣的试题

A.MouseUp事件是鼠标向上移动时触发的事件
B.MouseUp事件过程中的X,Y参数用于修改鼠标位置
C.在MouseUp事件过程中可以判断用户是否使用了组合键
D.在MouseUp事件过程中不能判断鼠标的位置
A.Private Sub Form_MouseDown(Button As Integer,_Shift As Integer,X As Single,
    Y As Single)
      If Button=1 And Blltton=2Then
        PopupMenu a1
      End If
    End Sub
B.Private Stlb Form_MouseDown(Button As Integer,_Shift As Integer,X As Single,
    Y As Single)
      PopupMenu a1
    End Sub
C.Private Sub Form—MouseDown(Button As Integer,_Shift As Integer,X As Single,
    Y As Single)
      If Button=1 Then
        PopupMenu a1
      End If
    End Sub
D.Private Sub Form MouseDown(Button As Integer,_Shift As Integer,X As Single,
Y As Single)
  If Buttcn=2 Then
        PopupMenu a1
      End If
End Sub
找试题 · 找答案 · 找资料 在线模考