以下能够正确计算1+2+3+…+10的程序是( )

9 查阅

以下能够正确计算1+2+3+…+10的程序是( )

A.PrivateSubCommand1_Click()

Sum=0ForC=1To10

Sum=Sum+1

NextC

PrintSum

EndSub

B.PrivateSubCommand1_Click()

Sum=0,C=1DoWhileC<=10

Sum=Sum+1

C=C+1

Loop

PrintSum

EndSub

C.PrivateSubCommand1_Click()

Sum=0;C=1Do

Sum=Sum+1C=C+1

Loop

WhileC>10

PrintSum

EndSub

D.PrivateSubCommand1_Click()

Sum=0;C=1Do

Sum=Sum+1

C=C+1

Loop

WhileC<10

PrintSum

EndSub