- 4
- 0
- 约5.43千字
- 约 6页
- 2021-02-12 发布于河南
- 举报
枣阳职教中心高二年级2016-2017年度下学期
《C语言》期末考试试题
考试时间:120分钟 总分:100分 命题人:张莹莹
一、单项选择(30*2’=60’)
1、#includestdio.h
main()
{
int a,b,c;
a=10;b=50;c=30;
if(ab) a=b,b=c;c=a;
printf(“a=%d b=%d c=%d\n”,a,b,c);
}
程序运行后的输出结果是( )
A. a=10 b=50 c=30 B. a=10 b=50 c=10
C. a=10 b=30 c=10 D. a=50 b=30 c=50
2、#includestdio.h
main()
{
int y=10;
while(y--); printf(“y=%d\n”,y);
}
程序运行后的输出结果是( )
A. y=0 B. y=-1 C. y=1 D.while构成无限循环
3、若有定义语句:int x=10; 则表达式x-=x+x的值为( )
A. 0 B.-20 C. -10 D. 10
4、#includestdio.h
main()
{
int a=1,b=0;
printf(“%d,”,b=a+b);
printf(
原创力文档

文档评论(0)