You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
題目說明:計算 1~100 的偶數總合<br />
檔案名稱:<strong>03</strong> \ ch6 \ P.172-1 延伸<br />
表單:<br />
程式碼:<br />
Private Sub Form_Activate()<br />
Dim i As Integer, sum As Integer<br />
sum = 0<br />
For i = 0 To 100 Step 2<br />
sum = sum + i<br />
Next i<br />
MsgBox "1~100 的偶數總合為" & sum, , "計算"<br />
End Sub<br />
執行結果: