请读程序 #include<stdio.h> func(int a, intb) {int c; c=a+b; return c; } main() {int x=6,y=7,z=8,r; r=func((x--,y,x+y),z--); printf("%d\n",r); } 上面程序的输出结果是( )。
A.11
B.20
C.21
D.31
A.11
B.20
C.21
D.31
第1题
以下程序用来统计文件中字符个数。请填空。 include "stdio. h" main() { FILE *fp;long num=OL; if((fp=fopen("fname.dat","r")==NULL) { Pirntf("Open error\n"); exit(0);} while(【 】) { fgetc(fp);num++; } printf("num=%1d\n",num-1); fclose(fp); }
第2题
有以下程序: #include <stdio. h > main() { int m =3,n =4,x; x= -m++; x=x+8/++n; prinff(" % d \n" ,x); } 程序运行后的输出结果是()。
A.3
B.5
C.-1
D.-2
第3题
有以下程序#include<stdio. h>main(){ char c1='1',c2='2'; c1=getchar(); c2=getchar(); putchar(c1); putchar(c2);} 当运行时输入:a<回车> 后,以下叙述正确的是
A.变量c1被赋予字符a,c2被赋予回车符
B.程序将等待用户输入第2个字符
C.变量c1被赋予字符a,c2中仍是原有字符2
D.变量c1被赋予字符a,c2中将无确定值
第4题
第5题
第6题
第7题
第8题
第9题
以下程序通过函数SunFun()调用F(x),x的值从0到10,这里F(x)=x2+1,由F函数实现,请填空。 include <stdio. h> int SunFun(int); int F(int); main () { pfintf("The sum = % d \n" ,SunFun(10) ); } SunFun(int n) { int x,s =0; for(x=0; x<=n; x++) s+ =F(【 】); return s; F(int x) { return (【 】);}
第10题
第11题
请读程序: include<stdio.h> define MUL(x,Y)(x)*Y void main() { int a=3,b=4,c; c=MUL(a++,b++); printf("%d\n",C); } 上面程序的输出结果是()。
A.12
B.15
C.20
D.16