下列代码哪行会出错: 1) public void modify() { 2) int I, j, k; 3) I = 100; 4) while ( I > 0 ) { 5) j = I * 2; 6) System.out.println (” The value of j is ” + j );7) k = k + 1; 8) I–; 9) } 10) } A: 4 B: 6 C: 7 D: 8
下列代码哪行会出错: 1) public void modify() { 2) int I, j, k; 3) I = 100; 4) while ( I > 0 ) { 5) j = I * 2; 6) System.out.println (” The value of j is ” + j );7) k = k + 1; 8) I–; 9) } 10) } A: 4 B: 6 C: 7 D: 8
下列程序的执行结果是______。 k =0 For i=1 To 3 a = i ^ i ^ k Print a; Next I A: 1 1 1 B: 1 2 3 C: 0 0 0 D: 1 4 9
下列程序的执行结果是______。 k =0 For i=1 To 3 a = i ^ i ^ k Print a; Next I A: 1 1 1 B: 1 2 3 C: 0 0 0 D: 1 4 9
4、下列代码( )会出错。1) public void modify() {2) int I, j, k;3) I = 100;4) while ( I >; 0 ) {5)j = I * 2;6) System.out.println (" The value of j is " + j );7) k = k + 1;8) I--;9) }10} A: line 4 B: line 6 C: line 7 D: line 8
4、下列代码( )会出错。1) public void modify() {2) int I, j, k;3) I = 100;4) while ( I >; 0 ) {5)j = I * 2;6) System.out.println (" The value of j is " + j );7) k = k + 1;8) I--;9) }10} A: line 4 B: line 6 C: line 7 D: line 8
设有定义:int i=0,j=0,k=0; 则执行语句++i||++j&&++k;后i,j,k的值为() A: i=1;j=1;k=1 B: i=1;j=0;k=1 C: i=1;j=0;k=0 D: i=0;j=0;k=0
设有定义:int i=0,j=0,k=0; 则执行语句++i||++j&&++k;后i,j,k的值为() A: i=1;j=1;k=1 B: i=1;j=0;k=1 C: i=1;j=0;k=0 D: i=0;j=0;k=0
以下程序段实现的输出是()。for(i=0;i<;=9;i++)s[i]=i;for(i=9;i>;=0;i--)printf("%2d",s[i]);[/i][/i] A: 9 7 5 3 1 B: 1 3 5 7 9 C: 9 8 7 6 5 4 3 2 1 0 D: 0 1 2 3 4 5 6 7 8 9
以下程序段实现的输出是()。for(i=0;i<;=9;i++)s[i]=i;for(i=9;i>;=0;i--)printf("%2d",s[i]);[/i][/i] A: 9 7 5 3 1 B: 1 3 5 7 9 C: 9 8 7 6 5 4 3 2 1 0 D: 0 1 2 3 4 5 6 7 8 9
定义数组char a[]=}'0','1','2','3');,则将该数组中元素按反序转换成整数,正确的程序段是______。 A: int k=0,i; for(i=0;i<4;i++) k=k*10+a-48; B: int k=0,i; for(i=3;i>=0;i--) k=k*10+a-'0'; C: int k=0,i; for(i=3;i>=0;i--) k=k+a-'0'; D: int k,i; for(i=3;i>=0;i--) k=k*10+a-'0';
定义数组char a[]=}'0','1','2','3');,则将该数组中元素按反序转换成整数,正确的程序段是______。 A: int k=0,i; for(i=0;i<4;i++) k=k*10+a-48; B: int k=0,i; for(i=3;i>=0;i--) k=k*10+a-'0'; C: int k=0,i; for(i=3;i>=0;i--) k=k+a-'0'; D: int k,i; for(i=3;i>=0;i--) k=k*10+a-'0';
Given the following code: 1) public void modify() { 2) int i, j, k; 3) i = 100; 4) while ( i > 0 ) { 5) j = i * 2; 6) System.out.println (" The value of j is " + j ); 7) k = k + 1; 8) i--; 9) } 10) } Which line might cause an error during compilation?() A: line 4 B: line 6 C: line 7 D: line 8
Given the following code: 1) public void modify() { 2) int i, j, k; 3) i = 100; 4) while ( i > 0 ) { 5) j = i * 2; 6) System.out.println (" The value of j is " + j ); 7) k = k + 1; 8) i--; 9) } 10) } Which line might cause an error during compilation?() A: line 4 B: line 6 C: line 7 D: line 8
给出下列代码,哪行在编译时可能会有错误?① public void modify(){② int i, j, k;③ i = 100;④ while ( i > 0 ){⑤ j = i * 2;⑥ System.out.println (" The value of j is " + j );⑦ k = k + 1;⑧ }⑨ } A: 4 B: 6 C: 7 D: 8
给出下列代码,哪行在编译时可能会有错误?① public void modify(){② int i, j, k;③ i = 100;④ while ( i > 0 ){⑤ j = i * 2;⑥ System.out.println (" The value of j is " + j );⑦ k = k + 1;⑧ }⑨ } A: 4 B: 6 C: 7 D: 8
Public Sub Proc(a%( )) Static i% Do a(i) = a(i) + a(i + 1) i = i + 1 Loop While i < 2 End Sub Private Sub Command1_Click( ) Dim m%, i%, x%(10) For i = 0 To 4: x(i) = i + 1: Next i For i = 1 To 2: Call Proc(x): Next i For i = 0 To 4: Print x(i);: Next i End Sub A: 3 4 7 5 6 B: 3 5 7 4 5 C: 2 3 4 4 5 D: 4 5 6 7 8
Public Sub Proc(a%( )) Static i% Do a(i) = a(i) + a(i + 1) i = i + 1 Loop While i < 2 End Sub Private Sub Command1_Click( ) Dim m%, i%, x%(10) For i = 0 To 4: x(i) = i + 1: Next i For i = 1 To 2: Call Proc(x): Next i For i = 0 To 4: Print x(i);: Next i End Sub A: 3 4 7 5 6 B: 3 5 7 4 5 C: 2 3 4 4 5 D: 4 5 6 7 8
下面代码的输出结果为( ) for i in range(1, 7): if i % 2 == 0: print(i, end=" ") A: 1 2 3 4 5 6 7 B: 1 2 3 4 5 6 C: 2 4 6 7 D: 2 4 6
下面代码的输出结果为( ) for i in range(1, 7): if i % 2 == 0: print(i, end=" ") A: 1 2 3 4 5 6 7 B: 1 2 3 4 5 6 C: 2 4 6 7 D: 2 4 6