以下能够正确计算1+2+3+…+10的程序是A.Private Sub Command1_Click() Sum=0 ForI=1 To 10 Sum=Sum+I Next I Print Sum End SubB.Private Sub Command1_Click() Sum=0,I=1 Do While I<=10 Sum=Sum+I I=I+1 Print Sum End SubC.Private Sub Command1_Click() Sum=0: I=1 Do Sum=Sum+I I=I+1 Loop While I<10 Print Sum End SubD.Private Sub Command1_Click() Sum=0: I=1 Do Sum=Sum+I I=I+1 Loop Until I<10 Print Sum End Sub

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

A.Private Sub Command1_Click() Sum=0 ForI=1 To 10 Sum=Sum+I Next I Print Sum End Sub

B.Private Sub Command1_Click() Sum=0,I=1 Do While I<=10 Sum=Sum+I I=I+1 Print Sum End Sub

C.Private Sub Command1_Click() Sum=0: I=1 Do Sum=Sum+I I=I+1 Loop While I<10 Print Sum End Sub

D.Private Sub Command1_Click() Sum=0: I=1 Do Sum=Sum+I I=I+1 Loop Until I<10 Print Sum End Sub


相关考题:

以下能够正确计算1+2+3+…+10的程序是( )A.PrivateSubCommand1_Click()Sum=0ForC=1To10Sum=Sum+1NextCPrintSumEndSubB.PrivateSubCommand1_Click()Sum=0,C=1DoWhileC=10Sum=Sum+1C=C+1LoopPrintSumEndSubC.PrivateSubCommand1_Click()Sum=0;C=1DoSum=Sum+1C=C+1LoopWhileC10PrintSumEndSubD.PrivateSubCommand1_Click()Sum=0;C=1DoSum=Sum+1C=C+1LoopWhileC10PrintSumEndSub

下列程序的功能是计算S=1!+2!+…+10!的值,完成程序填空。S=0FOR N=1 TO 10P=1FOR I=1 TO N【 】ENDFORS=S+PENDFOR?"SUM=",S

已知程序段: sum=0For i=1 to 10 step 3sum=sum+ii=i*2Nexti当循环结束后,变量i、sum的值分别为( )。A.10、6B.13、6C.13、5D.10、5

以下能够正确计算1+2+3+…+10的程序是A.Private sub Command1_Click( ) sum=0 For 1=1 To 10 Sum=sum+1, Next I Print Sum End SubB.Private sub Command1_Click( ) Sum=0,I=1 Do While l<=10 Sum=Sum+1 I=I+1 Print Sum End SubC.Private Sub command1_click( ) Sum=0:I=1 Do Sum=Sum+1 I=I+1 Loop While I<10 Print Sum End SubD.Private Sub command1_Click( ) Sum=0:I=1 Do Sum=Sum+1 l=I+1 Loop Until I<10 Print Sum End Sub

已知程序段:sum=0For i=1 to 10 step 3sum=sum+ii=i*2Next i当循环结束后,变量i、sum的值分别为( )。A.10、6B.13、6C.13、5D.10、5

若有以下程序段,sum和i都是整型变量,则不能与下面程序段等价的选项是() sum=0; i=2; while(i<=10) { sum=sum+i; i++; }A.for(i=2, sum=0; i<=10; i++) sum+=i;B.sum=0; i=2; do{ sum=sum+i; i++; }while(i<=10);C.sum=0; i=10; while(i>1) { sum=sum+i; i--; }D.sum=0; i=11; do{ sum=sum+i; i--; }while(i>1);

执行以下程序段,程序输出结果是()。 int i=5, sum1=0; sum2=0; while(i<=4) { sum1=sum1+i; i++; } do { sum2=sum2+i; i++; }while(i<=4); printf("sum1=%d, sum2=%dn",sum1, sum2);A.sum1=0, sum2=5B.sum1=0, sum2=0C.sum1=10, sum2=10D.sum1=4, sum2=0

下面程序可以正确求出1+2+3+。。。+n的和。() #include <stdio.h> int main() { int i = 1,sum = 0,n; scanf(“%d”,n); while (i <= n) sum = sum + i; ++i; printf("sum=%d",sum); return 0; }

在下列程序段中,不能计算1到100之间奇数之和的是__________。A.Dim sum As Integer sum = 0 For i = 1 To 100 Step 2 sum = sum + i NextB.Dim sum As Integer sum = 0 For i = 1 To 100 If i Mod 2 <> 0 Then sum = sum + i NextC.Dim sum As Integer sum = 0 For i = 1 To 99 sum = sum + i NextD.Dim sum As Integer sum = 0 For i = 100 To 1 Step -1 If i Mod 2 <> 0 Then sum = sum + i Next