下面程序的输出是:#includeintmain(){intx=100,a=10,b=20,ok1=5,ok2=0;if(a)if(b!=15)if(!ok1)x=1;elseif(ok2)x=10;x=-1;printf("%d\n",x);return0;}
查看答案
阅读程序:#includeintmain(){floatx,y;scanf("%f",&x);if(x<0.0)y=0.0;elseif((x<5.0)&&(x!=2.0))y=1.0/(x+2.0);elseif(x<10.0)y=1.0/x;elsey=10.0;printf("%f\n",y);return0;}若运行时从键盘上输入2.0并回车,则上面程序的输出结果是:
A. 0.000000
B. 0.250000
C. 0.500000
D. 1.000000
请读程序:#includeintmain(){intx=1,y=0,a=0,b=0;switch(x){case1:switch(y){case0:a++;break;case1:b++;break;}case2:a++;b++;break;}printf("a=%d,b=%d\n",a,b);return0;}上面程序的输出结果是:
A. a=2,b=1
B. a=1,b=1
C. a=1,b=0
D. a=2,b=2
阅读下面的程序:#includeintmain(){intk=-3;if(k<=0)printf("####");elseprintf("&&&&");return0;}上面程序片段的输出结果是:
A.
B. &&&&
C.
D. &&&&
E. 有语法错误,无输出结果
请写出下面程序的运行结果____。#include int main(){int a=200;if (a>100)printf("%d>100\n",a);elseprintf("%d<=100\n",a);return 0;}