题目内容

运行下面程序时,从键盘输入"2.0",则输出结果是___#include void main( ){ float a,b;scanf("%f",&a);if (a<0.0) b=0.0;else if ((a<0.5) && (a!=2.0)) b=1.0/(a+2.0);else if (a<10.0) b=1.0/2;else b=10.0;printf("%f\n",b);}

A. 0.000000
B. 1.000000
C. 0.500000
D. 0.250000

查看答案
更多问题

执行下面程序后,运行结果是_____.#include void main( ){ int x=41,y=1;if (x%3==0 && x%7==0){ y+=x;printf("y=%d\n",y);}else{y=x;printf("y=%d",y);}}

A. y=43
B. y=41
C. y=42
D. y=1

运行下面程序时,从键盘输入"12,34,9",则输出结果是____.#include void main( ){ int x,y,z;scanf("%d,%d,%d",&x,&y,&z);if (x

A. 34
B. 不确定的值
C. 9
D. 12

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

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

执行下列程序段后的输出结果是___int x=1,y=1,z=1;x+=y+=z;printf("%d\n",x

A. 3
B. 4
C. 1
D. 2

答案查题题库