单项选择题
有以下程序
#include<stdio.h>
main()
int x=1,y=0;
if(!x)y++;
else if(x==0)
if(x)y+=2;
else y+=3;
printf("%d\n",y);
程序运行后的输出结果是______。
A.0
B.2
C.1
D.3
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序 #include<stdio.h> main() int a=0,b=0,c=0,d=0; if(a=1)b=1;c=2; else d=3; printf( %d,%d,%d,%d n ,a,b,c,d); 程序输出______。
A.编译有错
B.0,0,0,3
C.1,1,2,0
D.0,1,2,0
点击查看答案&解析
单项选择题
若有以下程序 #include<stdio.h> main() int a=1,b=2,c=3,d=4; if((a=2)||(b=1))c=2; if(c==3)&&(d=-1))a=5; printf( %d,%d,%d,%d n ,a,b,c,d); 则程序的输出结果是______。
A.2,2,2,4
B.2,1,2,-1
C.5,1,2,-1
D.1,2,3,4
点击查看答案&解析
相关试题
以下不构成无限循环的语句或语句组是___...
有以下程序 #include<stdio.h> main...
关于“while(条件表达式)循环体”,以下...
在以下给出的表达式中,与while(E)中的(...
有以下程序 #include<stdio.h> main...