C语言高手来帮忙1111222

来源:百度知道 编辑:UC知道 时间:2024/06/19 20:57:33
19. 下列程序执行后输出的结果是
#include 〈stdio.h〉
f(int a)
{ int b=0;
int c=3;
a=c+ +,b+ +;
return(a);
}
main( )
{ int a=2,i,k;
for(i=0;i〈2;i+ +)
k=f(a+ +);
printf("%d\n",k);
}
(3分)
A、 B、 C、 D、
A、3
B、0
C、1
D、4

20. 若有以下程序
#include
void f(int n);
main()
{ void f(int n);
f(5);
}
void f(int n)
{ printf("%d\n",n); }
则以下叙述中不正确的是
(3分)
A、 B、 C、 D、 F、
A、若只在主函数中对函数f进行说明,则只能在主函数中正确调用函数f
B、若在主函数前对函数f进行说明,则在主函数和其后的其它函数中都可以正确调用函数f
C、对于以上程序,编译时系统会提示出错信息:提示对对f函数重复说明
D、函数f无返回值,所以可用void将其类型定义为无值型
F、

21. C语言中函数返回值的类型由( )决定。(3分)
A、 B、 C、 D、
A、return语句中的表达式类型
B、调用函数的主调函数类型

第一题:A
对于a++这样的运算应该先取值再运算。

第二题:源码就不对吧 #include <stdio.h> 除了F外没发现不对的。

第三题:D
第四题:C
第五题:C
第六题:C
第七题:A

21D
22B
23B
24C
25C

1d2b3b4c5a