安徽大学C语言期末试卷DOC.docx

安徽大学 C 语言程序设计期末试题 一. 单项选择题:(每题 2 分,共 20 分) 1.执行程序: int a; printf(%d \n, (a=3*5, a*4, a+5) );后,a 的值是 。A)60 B)20 C)15 D)10 2.程序段:int x=023; printf(%d \n, --x );的输出是 。A)19 B)18 C)23 D)22 程序段:static char s[10]={C,h,i,n,a}; printf(%d\n,strlen(s));的输出是 。 A)6 B)5 C)11 D)10 若 fun( int x) { printf(“%d\n”,x);}, 则 fun 。 A)返回值为 void 类型C)返回值为 int 类型 有宏定义:#define MULT1(a,b) a*b #define MULT2(a,b) (a)*(b) B)返回值类型无法确定D)没有返回值 且引用宏:y=MULT1(3+2,5+8); z=MULT2(3+2,5+8); 则 y 和 z 的值是 。 A)y=65,z=65 B)y=21,z=65 C)y=65,z=21 D)y=21,z=21 程序段 char s[]=Hello, *p; p=s; 执行后,*(p+5)的值是 。 A)o B)\0 C)o的地址 D)不确定的值 程序段

文档评论(0)

1亿VIP精品文档

相关文档