单项选择题
两次运行下列的程序,如果从键盘上分别输入3和1,则输出结果是( )。
main()
int x;
scanf("%d",&x);
if(x++>2)printf("%d",x);
else printf("%d\n",x--);
A) 4和2
B) 4和1
C) 4和0
D) 3和1
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序: #include<stdio.h> main() int x=1,y=0,a=0,b=0; switch(x) case 1: switch(y) case 0:a++;break; case 1:b++;break; case 2:a++;b++;break; case 3:a++;b++; printf( a=%d,b=%d n ,a,b); 程序的运行结果是______。
A) a=1,b=0
B) a=2,b=2
C) a=1,b=1
D) a=2,b=1
点击查看答案&解析
单项选择题
若变量已正确定义并赋值,以下符合C语言语法的表达式是
A) a:=b+1
B) a=b=c+2
C) int 18.5%3
D) a=a+7=c+b
点击查看答案&解析
相关试题
有以下程序: #include <stdio.h> v...
有以下程序: #include<stdio.h> mai...
有以下程序: main() unsigned char ...
有以下程序 #include<stdio.h> main...
以下程序的输出结果是( )。 #include...