第四章测试
1.if语句后面的表达式只能是关系表达式。( )
A:对 B:错
答案:B
2.在switch语句中必须使用break语句。( )
A:对 B:错 3.以下程序的运行结果是( )。#include ”stdio.h”main(){ int a=1;if (a++>1) printf(”%d\n”, a);else printf(”%d\n”, a--);}
A:1 B:0 C:3 D:2 4.以下程序的运行结果是( )。#include ”stdio.h”main(){ int a=3,b=4,c=5,d=2;if(a>b)if(b>c)printf("%d",d++);elseprintf("%d",++d);printf("%d\n",d);}
A:2 B:5 C:32 D:3 5.以下程序的运行结果是(C)。#include "stdio.h"main(){int a=2;a++;switch( ){case 1: printf("星期一\n");break;case 2: printf("星期二\n"); break;case 3: printf("星期三\n"); break;case 4: printf("星期四\n"); break;case 5: printf("星期五\n"); break;case 6: printf("星期六\n"); break;default:printf("星期天\n");}}
A:星期三 B:星期二 C:星期星期天 D:星期一

温馨提示支付 ¥3.00 元后可查看付费内容,请先翻页预览!
点赞(2) dxwkbang
返回
顶部