题目内容

C语言程序总是从 开始执行。

A. 主过程
B. 子程序
C. 主函数
D. 主程序

查看答案
更多问题

运行下面程序时,从键盘输入字母H,则输出结果是 ( )char ch;ch=getchar();switch(ch){case 'H': printf("Hello!\n");case 'G': printf("Good morning!\n");default : printf("Bye_Bye!\n");}

A. Hello!
B. Hello!Good morning!
C. Hello!Good morning!Bye_Bye!
D. Hello!Bye_Bye!

下面程序的输出结果是:( )int x=8,y=-7,z=9;if(x

A. 8
B. 1
C. 9
D. 0

if语句的嵌套结构中,为了避免出现二义性,C语言规定:()

A. else总是与缩进位置相同的if配对
B. else总是与在其之前未配对的if配对
C. else总是与同一行的if配对
D. else总是与在其之前未配对的最近的if配对

若有以下定义: float x; int a,b; 则正确的switch 语句是( )

A. switch(x){case 1.0:printf("*\n");case 2.0: printf("**\n");}
B. switch(x){case 1,2:printf("*\n");case 3: printf("**\n");}
C. switch(a+b){case 1:printf("*\n");case 1-2: printf("**\n");}
D. switch(a-b){case 1:printf("*\n");case 2: printf("**\n");}

答案查题题库