下列代码哪行会出错: 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
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
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 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
已知i、j、k为int型变量,若要从键盘输入2、3、4<CR>,使I、j、k的值分别为2、3、4, A: scanf("%3d,%3d,%3d",&i,&j,&k); B: scanf("%d,%d,%d",&i,&j,&k); C: scanf("%d%d%d",&i,&j,&k); D: seanf("i=%dj=%d,k=%d",&i,&j,&k);
已知i、j、k为int型变量,若要从键盘输入2、3、4<CR>,使I、j、k的值分别为2、3、4, A: scanf("%3d,%3d,%3d",&i,&j,&k); B: scanf("%d,%d,%d",&i,&j,&k); C: scanf("%d%d%d",&i,&j,&k); D: seanf("i=%dj=%d,k=%d",&i,&j,&k);
产生并输出如下形式的方阵。 1 2 2 2 2 2 1 3 1 2 2 2 1 4 3 3 1 2 1 4 4 3 3 3 1 4 4 4 3 3 1 5 1 4 4 3 1 5 5 5 1 4 1 5 5 5 5 5 1 #include "stdio.h" int main() { int a[7][7],i,j; for(i=0;i<7;i++) for(j=0;j<7;j++) if( (1) || i+j==6) a[i][j]=1; else if ( (2) &&i+j<6) a[i][j]=2; else if (i>j&&i+j<6) a[i][j]=3; else if (i i==j ; j==i ii i+j>6; j+i>6; 6
产生并输出如下形式的方阵。 1 2 2 2 2 2 1 3 1 2 2 2 1 4 3 3 1 2 1 4 4 3 3 3 1 4 4 4 3 3 1 5 1 4 4 3 1 5 5 5 1 4 1 5 5 5 5 5 1 #include "stdio.h" int main() { int a[7][7],i,j; for(i=0;i<7;i++) for(j=0;j<7;j++) if( (1) || i+j==6) a[i][j]=1; else if ( (2) &&i+j<6) a[i][j]=2; else if (i>j&&i+j<6) a[i][j]=3; else if (i i==j ; j==i ii i+j>6; j+i>6; 6
给出下列的代码,( )行在编译时可能会有错误。 ① 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: 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: 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.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.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+l; ⑧} ⑨} 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+l; ⑧} ⑨} A: line 4 B: line 6 C: line 7 D: line 8