单选题 VB
题号 #2273101

下面程序的执行结果是(  )。
Private Sub Command1Click(  )
a=10
For k=1 To 5 Step-I
a=a-k
Next k  
Print a;k
End Sub

进入在线模考

参考答案

D

答案解析

D。【解析】指定的步长为-1,但k指定从1到5,所以该for循环不会执行,a的值为10,k的值为1。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考