设有如下程序段:x = 2For i = 1 To 10 Step 2x = x + iNext运行以上程序后,x的值是()。
查看答案
在窗体上添加一个命令按钮Command1,然后编写如下事件过程:Private Sub Command1_Click()Dim num As Integernum = 1Do Until num > 6Print num;num = num + 2.4LoopEnd Sub程序运行后,单击命令按钮,则窗体上显示的内容是()。
A. 1 3.4 5.8
B. 1 4 7
C. 1 3 5
D. 无数据输出
下列程序代码执行时,内循环执行的次数是()。Private Sub Command1_Click()For i = 1 To 3For j = 1 To iFor k = j To 3s = s + 1Next kNext jNext iPrint sEnd Sub
A. 21
B. 3
C. 14
D. 9
下列程序代码的运行结果为()。Private Sub Command1_Click()For m = 1 To 10 Step 2a = 10For n = 1 To 20 Step 2a = a + 2Next nNext mPrint aEnd Sub
A. 20
B. 30
C. 50
D. 60
在窗体上添加一个命令按钮Command1,然后编写如下事件过程:Private Sub Command1_Click()For i = 1 To 4x = 4For j = 1 To 3x = 3For k = 1 To 2x = x + 6Next kNext jNext iPrint xEnd Sub程序运行后,单击命令按钮,显示结果为()。
A. 157
B. 15
C. 7
D. 538