下列语句执行后变量的值是 n=0 For i=1 to 5 n=n+i Next iA.15B.10C.14D.13
下列语句执行后变量的值是 n=0 For i=1 to 5 n=n+i Next i
A.15
B.10
C.14
D.13
参考答案和解析
7 7
相关考题:
以下程序的输出结果是 ______。 Dim n(2,2), i, j As Integer For i = 0 To 2 For j = 0 To 2 n(i,j) = i + j Next j Next i For i = 0 To 1 For j = 0 To 1 n(i+ 1 ,j + 1) = n(i + 1,j + 1) + n(i, j) Next j Next i Print n(i, j)A.14B.0C.6D.值不确定
假定有以下程序段 n=0 for i=1 to 4 for j=3 to-1 step-1 n=n+1 next j next i 运行完毕后n的值是( )。A.12B.15C.16D.20
单击命令按钮后,下列程序代码的执行结果是______。Public Sub fun (a As Integer, b As Integer, c As Integer)Doa=b+ cn=n+1Loop While n > 3End SubPrivate Sub command1_ click()Dim m As Integer, n As Integer, i As IntegerFor i = 0 To 2: m = n + 1: Next iFor i = 1 To 2: Call fun (m, n, i): Next iFor i = 0 To 3Print m;Next iEnd Sub
假定有以下程序段: n=0 for i=1 to 4 for j=3 to -1 step -1 n=n+l next j next i运行完毕后n的值是( )。A.12B.15C.16D.20
下列程序段的执行结果为_______。 N=0 For I=1 To 3 For J=5 To 1 Step -1 N=N+1 Next J Next I Print N;J;IA.12 0 4B.15 0 4C.12 3 1D.15 3 1
下列程序中的for 循环执行的次当次数是______。 #define N 2 #define M N+i #define NUM 2*M+l #main ( ) { int i; for (i=1;i<=NUM;i++) printf ("%d\n", i); }A.5B.6C.7D.8
下列程序段的执行结果为______。 N=0 For I=1 To 3 For J=5 To 1 Step-1 N=N+1 Next J Next I Print N; J; IA.12 O 4B.15 0 4C.12 3 1D.15 3 1
单选题以下程序段运行后变量n的值为() inti=1,n=1; for(;i3;i++) {continue;n=n+i;}A4B3C2D1