VB编程计算0-100间的奇数和急

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/07 20:37:29

VB编程计算0-100间的奇数和急
VB编程计算0-100间的奇数和

VB编程计算0-100间的奇数和急
Private Sub iTest()
Dim s%,i%,ms$
For i = 1 To 100
If i Mod 2 = 1 Then
s = s + i
ms = ms & vbTab & i
Next i
' Print "0-100间的奇数和为:" & s
MsgBox "0-100间的奇数和为:" & s & vbCrLf & ms
End Sub