位置:首页 > 题库频道 > 其它分类 > 计算机其它 > 二级二级VB07年4月计算机等级考试二级VB考前密卷(1)

单击按钮时,以下程序运行后的输出结果是Private Sub Command1_Click()Dim x As Integer, y As Integer, z As Integerx=1: y=2: z=3Call God(x, x, z)Print x; x; zCall God(x, y, y)Print x; y; yEnd SubPrivate Sub God(x As Integer, y As Integer, z As Integer)x=3 * z + 1y=2 * zz=x + yEnd Sub

发布时间:2024-07-09

A.6 6 127 11 11

B.8 5 105 11 11

C.9 6 129 10 15

D.8 10 105 9 10

试卷相关题目

  • 1下面程序段,运行后的结果是Private Sub Command1_Click()Dim b%(1 To 4) , i%, t#For i=1 To 4b(i) =iNext it=Tof(b() )Print "t="; t,End SubFunction Tof(a() As Integer)Dim t#, i%t=1For i=2 To UBound(A)t=t * a(i)Next iTof=tEnd Function

    A.t=18

    B.t=24

    C.t=30

    D.t=32

    开始考试点击查看答案
  • 2在窗体上画一个命令按钮,然后编写下列程序Private Sub Command3_Click()Tcl 2Tcl 3Tcl 4End SubSub Tcl(a As Integer)Static x As Integerx=x + aPrint x;End Sub程序运行后,单击命令按钮,输出结果为

    A.2 3 4

    B.2 5 9

    C.3 5 4

    D.2 4 3

    开始考试点击查看答案
  • 3下列程序的执行结果为Private Sub Command1_Click()Dim x As Integer, y As Integerx=12: y=20Call Value(x, y)Print x; yEnd SubPrivate Sub Value(ByVal m As Integer, ByVal n As Integer)m=m * 2: n=n - 5Print m; nEnd Sub

    A.20 1220 15

    B.12 2012 25

    C.24 1512 20

    D.24 1212 15

    开始考试点击查看答案
  • 4以下程序段的输出结果为Dim l, a(10) , p(3)k=5For i=0 To 10a(i) =iNext iFor i=0 To 2p(i) =a(i (i + 1) )Next iFor i=0 To 2k=k + p(i) 2Next iPrint k

    A.20

    B.21

    C.56

    D.32

    开始考试点击查看答案
  • 5以下程序段运行时从键盘上输入字符"-",则输出结果为op$=InputBox("op=")If op$="+" Then a=a + 2If op$="-" Then a=a - 2Print a

    A.2

    B.-2

    C.0D.+2

    开始考试点击查看答案
返回顶部