更多"有如下程序段,该程序段执行完后,共执行循环的次数是 Privat"的相关试题:
[单项选择]有如下的程序段,该程序段的执行完后,共执行循环的次数是 Private Sub Command1_Click( ) total=0 Counter=l Do Print Counter total=total+Counter Print total Counter=Counter+1 If total>=10 Then Exit Do End If Loop While Counter<=10 End Sub
A. 5
B. 10
C. 12
D. 20
[单项选择]有如下程序段:
Private Sub Command1_Click( )
Dim a As Integer
a=2
For i=1 To 3
Print G(a)
Next i
End Sub
Function G(a As Integer)
b=0
Static c
b=b + 1
c=c + 1
G=a + b + c
End Function
运行上面的程序后,单击命令按钮,输出结果为( )。
A. 窗体文件的扩展名为.frm
B. 一个窗体对应一个窗体文件
C. Visual Basic中的一个工程只包含一个窗体
D. Visual Basic中一个工程最多可以包含255个窗体
[填空题]执行如下程序段后,输出结果为 (7) 。
Private Sub Command1_Click( )
sum=0
For i=1 To 18 Step 2
For j=2 T0 6
If (Mod j)<>0 Then sum=sum+j
Next
Next
Print sum.
End Sub
[填空题]执行如下程序段后,intsum的值为 【13】 。
Private Sub Command1_Click( )
sum=0
For i=1 To 18 Step 2
For j=2 To 6
If(i Mod j)<>0 Then sum=sum+j
Next
Next
Print sum
End Sub
[填空题]执行如下程序段后,intsum的值为______。
Private Sub Command1_Click( )
sum=0
For i=1 To 18 Step 2
For j=2 To 6
If(i Modj)<>0 Then sum=sum+j
Next
Next
Print sum
End Sub
[填空题]执行如下程序段后,intsum的值为______。
Private Sub Command1_Click( )
sum=0
For i=1 To 18 Step 2
For j=2 To 6
If(i Modj)<>0 Then sum=sum+j
Next
Next
Print sum
End Sub
[单项选择]有如下的程序片段,该程序片段的执行完后,共执行循环______次。
Private Sub command1_ Click( )
total =0
Counter = 1
do
Print Counter
total = total + Counter
Print total, "111"
Counter = Counter + 1
if total >= 10 then
exit do
End if
Loop while Counter <= 10
End Sub
[单项选择]有如下的程序片段,该程序片段的执行完后,共执行循环______次。
Private Sub command1_ Click( )
total =0
Counter = 1
do
Print Counter
total = total + Counter
Print total, "111"
Counter = Counter + 1
if total >= 10 then
exit do
End if
Loop while Counter <= 10
End Sub
[填空题]下面程序段的运行结果是 【15】 。
Option Base 1
Private Sub Swap (a( ) As Integ
For I=1 to 10/2
t=a(I)
a(I)=a(10-I+1)
a(10-I+1)=t
Next I
End Sub
Private Sub Form_Click( )
Dim x(10) As Integer
For I=1 to 10
x(I)=I*2
Next I
Swap x( )
For I=1 to 10
Print x(I)
Next I
End Sub
[填空题]下面程序段的运行结果是 【15】 。
Option Base 1
Private Sub Swap (a( ) As Integ
For I=1 to 10/2
t=a(I)
a(I)=a(10-I+1)
a(10-I+1)=t
Next I
End Sub
Private Sub Form_Click( )
Dim x(10) As Integer
For I=1 to 10
x(I)=I*2
Next I
Swap x( )
For I=1 to 10
Print x(I)
Next I
End Sub
[填空题]下面程序段的运行结果是 【14】 。
Option Base 1
Private Sub swap(a( ) As Integer)
For I = 1 to 10/2
t =a(I)
a(I) = a(10-I+l)
a(10-I+1) = t
Next I
End Sub
Private Sub Form Click( )
Dim x(10) As Integer
For I = 1 to 10
x(I) = I * 2
Next I
Swap x( )
For I=1 to 10
Print x(I)
Next I
End Sub
[填空题]下面程序段的运行结果是 【14】 。
Option Base 1
Private Sub swap(a( ) As Integer)
For I = 1 to 10/2
t =a(I)
a(I) = a(10-I+l)
a(10-I+1) = t
Next I
End Sub
Private Sub Form Click( )
Dim x(10) As Integer
For I = 1 to 10
x(I) = I * 2
Next I
Swap x( )
For I=1 to 10
Print x(I)
Next I
End Sub