【单选题】程序段: int i,a[3][3]={9,8,7,6,5,4,3,2,1}; for(i=0;i<3;i+=1) printf("%4d",a[1][i]); 运行此程序段,输出结果是:()A.6 5 4B.9 5 1C.9 6 3D.9 8 7

【单选题】程序段: int i,a[3][3]={9,8,7,6,5,4,3,2,1}; for(i=0;i<3;i+=1) printf("%4d",a[1][i]); 运行此程序段,输出结果是:()

A.6 5 4

B.9 5 1

C.9 6 3

D.9 8 7


参考答案和解析
D 本题考察for循环语句,注意第二个for语句的后面有一个分号,即printf函数不属于循环体,无论循环执行多少次,printf(”*”)语句只执行一次。因此,本题正确答案为D)。

相关考题:

( 11 )有以下程序#include stdio.hmain (){ int a[3][3]={{1,2,3},{4,5,6},{7,8,9}};int b[3]={0},i;for ( i=0;i3;i++ ) b[i]=a[i][2]+a[2][i];for ( i=0;i3;i++ ) printf ( " %d " ,b[i] ) ;printf ( " \n " ) ;}程序运行后的输出结果是 【 11 】 。

有以下程序main(){ int i,t[][3]={9,8,7,6,5,4,3,2,1};for(i=0;i3;i++) printf(" % d",t[2-i][i]);}程序执行后的输出结果是A)7 5 3B)3 5 7C)3 6 9D)7 5 1

下列程序执行后的输出结果是void func1(int i);void func2(int i);char st[]="hello,friend!";void func1(int i){ printf("%c",st[i]);if(i3){i+=2;func2(i);}}void func2(int i){ printf("%c",st[i]);if(i3){i+=2;func1(i);}}main(){ int i=0; func1(i); printf("\n");}A.helloB.helC.hloD.hlm

下列程序段选择项,使i的运行结果为3的程序段是( )。A.int i=0,j=O; (i=2,(j++)+i);B.int i=1,j=0; j=i=((i=3)*2);C.int i=0,j=1; (j=1)?(i=1):(i=3);D.int i=1,j=1; i+=j+=1;

以下程序的运行结果是______。includemain(){ int fun();fun();}fun(){static int a[3]= 以下程序的运行结果是______。include<stdio.h>main(){ int fun();fun();}fun(){static int a[3]={0,1,2};int i;for(i=0;i<3;i++)a[i]+=a[i];for(i=0;i<3;i++)printf("%d,",a[i]);pfintf("\n",);}

有以下程序:include main( ){int i,t[ ] [3] = {9,8,7,6,5,4,3,2,1};for(i=0;i 有以下程序:#include <stdio.h>main( ){int i,t[ ] [3] = {9,8,7,6,5,4,3,2,1}; for(i=0;i<3;i++) printf("%d ",t[2-i]l-i]);}程序执行后的输出结果是( )。A.7 5 3B.3 5 7C.3 6 9D.7 5 1

有以下程序: main() { int a[3][3], *p, i; p=a[0][0]; for(i=0; i<9; 1++)p[i]=i; for (i=0; i<3; i++)printf("% d", a[1][i]); 程序运行后的输出结果是______。A.0 1 2B.1 2 3C.2 3 4D.3 4 5

下列程序执行后的输出结果是______。A.helloB.helC.hloD.hlm void func1 (int i); void func2 (int i); char st[]="hello,friend!"; void func1(int i) { printf("%c",st[i]); if(i<3){ i+=2;func2(i); } } void func2 (int i) { printf("%c",st[i]); if(i<3){ i+=2;func1(i); } } main() { int i=0;func1(i);printf("\n");}

有以下程序main( ){ int a[3][3],*p,i;p=a[0][0];for(i=0;i9;i++) p[i]=i+1;printf("%d \n",a[1][2]);}程序运行后的输出结果是A.3B.6C.9D.2

有以下程序inculde stdio.hmain(){ int a[3][3]={(1,2,3),(4,5,6),(7,8,9)};int B[3]={0},i;For(i=0;i3;i ++) B[i]=a[i][2]+a[2][i];For(i=0;13;i ++) printF(“%d”,B[i]);printF(“\n”);}程序运行后的输出结果是【1】。

有以下程序: main() { int a[3][3],*p,i; p=a[0][0]; for(i=0;i<9;i++)p[i]=i; for(i=0;i<3;i++)printf("%d",a[1][i]); } 程序运行后的输出结果是 ______。A.0 1 2B.1 2 3C.2 3 4D.3 4 5

有以下程序main ( ) { int a[3] [3],*p, i; p=a[0] [0]; for (i=0;i<9; i++) p[i] =i; for(i=0;i<3;i++) printf ("%d" ,a[1] [i] );} 程序运行后的输出结果是A.12B.123C.234D.345

有以下程序 main() {int i,t[][3]={9,8,7,6,5,4,3,2,1}; for(i-0;i<3;i++) printf("%d",t[2-i][i]); } 程序执行后的输出结果是______。A.753B.357C.369D.751

有以下程序:include main ( ){int a[3] [3] , *p,i; p=a[0][0];for(i=0;i 有以下程序: #include <stdio.h> main ( ) { int a[3] [3] , *p,i; p=a[0][0]; for(i=0;i<9; i++)p[i]=i: for(i=0; i<3;i++)Printf("%d",a[1][i]); } 程序运行后的输出结果是( )。A.012B.123C.234D.345

下列程序执行后的输出结果是()。includevoid func1(int i);void func2(int i);char st[ 下列程序执行后的输出结果是( )。 #include<stdio.h> void func1(int i); void func2(int i); char st[]="hello,friend!"; void funcl(int i) { printf("%c",st[i]); if(i<3){i+=2;func 2(i);} } void func 2(int i) { printf("%c",st[i]); if(i<3){i+=2;funcl(i);} } main() { int i=0; funcl(i);printf("\n"); }A.helloB.helC.hloD.hlm

以下程序的输出结果是_______。 main() { int i,x[3][3]={9,8,7,6,5,4,3,2,1},*p=x[1][1]; for(i=0;i<4;i+=2)printf("%d",p[i]); }A.5 2B.5 1C.5 3D.9 7

下列程序的输出结果是______。include main(){ int i=1,j=3; printf("%d,",i++); {int 下列程序的输出结果是______。#include <stdio.h>main (){ int i=1,j=3; printf("%d,",i++); { int i=0; i+=j*2; printf("%d,%d,",i,j); } printf("%d,%d\n",i,j);}A.1,6,3,1,3B.1,6,3,2,3C.1,6,3,6,3D.1,7,3,2,3

有以下程序:main(){ int a[3][3],*p,i;p=a[0][0];for(i=0;i<9;i++)p[i]=i+1;printf("%d\n",a[1][2]);}程序运行后的输出结果是【 】。

有下列程序void func1(int i);void func2(int i);char st[ ]="hello,friend! ";void func1(int i){ printf("%c",st[i]); if(i3){i+=2;func2(i);}}void func2(int i){ printf("%c",st[i]); if(i3){i+=2;func1(i);}}main(){ int i=0;func1(i); printf("\n");}执行后的输出结果是A.hello B.helC.hlo D.hlm

下列程序 void func1(int i); void func2(int i) char st[]="hello,friend!"; void funcl(int i) { printf("%c",st[i]); if(i<3){i+=2;func2(i);} } void func2(int i) { printf("%c",st[i]); if(i<3){i+=2;funcl(i);} } main() { int i=0;funcl(i);printf("\n");} 执行后的输出结果是( )A.helloB.helC.hloD.hlrn

以下程序的输出结果是()。includemain(){inti,x[3][3]={9,8,7,6,5,4,3,2,1},*p=x[ 以下程序的输出结果是( )。 #include <stdio.h> main() { int i,x[3][3]={9,8,7,6,5,4,3,2,1},*p=x[1][1]; for(i=0;i<4;i+=2) printf("%d",p[i]); }A.52B.51C.53D.97

下列程序执行后的输出结果是( )。 void funcl(int i); void func2(int i); char st[]="hello,friend!"; void funcl(int i) { printf("%C",st[i]); if(i<3) { i+=2;func2(i); ) } void func2(int i) {printf("%c",st[i]); if(i<3) { i+=2;func1(i); } } main() {int i=0;funcl(i);printf("\n"); )A.hlmB.hloC.helloD.he1

有以下程序:includemain() {int a[3][3],*p,i; p=a[0][0]; for(i=0;i 有以下程序: #include <stdio.h> main() { int a[3][3],*p,i; p=a[0][0]; for(i=0;i<9;i++) p[i]=i+1; printf("%d\n",a[1][2]); } 程序运行后的输出结果是( )。A.3B.6C.9D.2

以下程序的输出结果是______。 main() { int i, x[3][3]={9,8,7,6,5,4,3,2,1},*p=x[1][1]; for(i=0;i<4;i+=2)printf("%d",p[i]); }A.52B.5 1C.5 3D.97

有以下程序 main() { int a[3][3],*p,i; p=a[0][0]; for(j=0;i<9;i++)p[i]=i; for(i=0;i<3;i++)printf("%d",a[1][i]); } 程序运行后的输出结果是A.12B.123C.234D.345

下列程序执行后的输出结果是 ( ) main( ) {int a[3][3],* p,i; p= a[0][0]; for(i=0;i<9;i+ +)p[i]=i+1; printf("%d\n",a[1][2]); }A.3B.6C.9D.随机数

有程序: main( ) { int x,i; for(i=1;i<50;i+ +) { x=i; if(+ +%2==0) if(x%3==0) if(x%7==0) printf("%d",i); } } 输出结果是 ( )A.28B.27C.42D.41

单选题有以下程序:#include int sum(int *array,int len){ if(len == 0)  return array[0]; else  return array[0]+sum(array+1,len-1);}main(){ int i=1,j=3; printf(%d,,i++); {  int i = 0;  i+=j*2;  printf(%d,%d,,i,j); } printf(%d,%d,i,j);}程序运行后的输出结果是(  )。A1,6,3,1,3B1,6,3,2,3C1,6,3,6,3D1,7,3,2,3