若有以下程序 #include main() { int a=0,b=0,c=0,d; c= (a+=b,, b+=a); /*第4行*/ d=c;; /*第5行*/ ; /*第6行*/ ;printf("%d,%d,%d\n",a,b,c); /*第7行*/ }
举一反三
- 若有以下程序 #include main() { int a=0,b=0,c=0,d; c= (a+=b,, b+=a); /*第4行*/ d=c;; /*第5行*/ ; /*第6行*/ ;printf("%d,%d,%d\n",a,b,c); /*第7行*/ } 编译时出现错误,你认为出错的是( )。
- 下面的程序中哪一行有错误( )。 A: nclude <stdio.h> B: in() C: oat array[5]={0.0}; //第A行 int i; for(i=0;i<5;i++) scanf("%f",&array[i]); for(i=1;i<5;i++) array[0]=array[0]+array[i];//第B行 printf("%f\n",array[0]); //第C行 D: 第A行 E: 第B行 F: 第C行 G: 没有
- 中国大学MOOC: 若有以下程序 #include <stdio.h> main(){ int a=0,b=0,c=0; c= (a -= ++a), (a+=b, b+=4); printf("%d,%d,%d\n",a,b,c); }则程序的输出结果是( )
- 若有以下程序 main() { int a=0,b=0,c=0; c= (a+=++b, b+=4); printf("%d,%d,%d\n",a,b,c); } 则程序的输出结果是 A: 1,5,1 B: -1,4,-1 C: -1,4,4 D: 1,5,5
- 选择下面程序运行的结果: 第2条printf语句行输出的结果为() A: 2 B: 4 C: 6 D: 0