更多“假定所有变量均已正确说明,以下程序段运行后的输出结果是 。 int k; k=-3; if(k<=0) printf(“####”); else printf(“&&&&…”相关的问题
第1题
假定所有变量均已正确说明,以下程序段运行后的输出结果是 。 int k; k=-3; if(k<=0) printf(“####”); else printf(“&&&&”);
A.####
B.&&&&
C.####&&&&
D.有语法错误,无输出结果
点击查看答案
第2题
假定所有变量均已正确说明,以下程序段运行后的输出结果是()。 int k=5; while(--k) printf("%d", k-=3); printf("n");
点击查看答案
第3题
假定所有变量均已正确说明,以下程序段运行后的输出结果是 。 int a=1,b=3,c=5; if(c=a+b) printf("yesn"); else printf("non");
点击查看答案
第4题
假定所有变量均已正确说明,以下程序段运行后的输出结果是 。 int x=0; do { x= -1*x; }while(!x);
A.是死循环
B.循环执行一次
C.循环执行二次
D.有语法错误
点击查看答案
第5题
假定所有变量均已正确说明,以下程序段运行后的输出结果是 。 int a=3,b=5,c=7; if(a>b) a=b; c=a; if(c!=a) c=b; printf("%d,%d,%dn",a,b,c);
A.程序段有语法错
B.3,5,3
C.3,5,5
D.3,5,7
点击查看答案
第6题
假定所有变量均已正确说明,以下程序段运行后的输出结果是 。 int n=0,m=l,x=2; if(!n) x-=l; if(!m) x-=2; if(!x) x-=3; printf (" %dn",x);
点击查看答案
第7题
假定所有变量均已正确说明,以下程序段运行后的输出结果是 。 x=0,y=5,z=31; while(z-->0&&++x<5)y=y-1; printf("%d,%d,%dn",x,y,z);
A.3,2,0
B.3,2,-1
C.4,3,-1
D.5,-2,-5
点击查看答案
第8题
假定所有变量均已正确说明,以下程序段运行后的输出结果是()。 int t,a=1,b=5,c=-2; while(a>b>c) { t=a; a=b; b=t; c++;} printf("%d, %d, %d", a,b,c);
A.1, 5, 0
B.1, 5, -2
C.5, 1, -1
D.5, 1, -2
点击查看答案
第9题
假定所有变量均已正确说明,以下程序段运行后的输出结果是 。 int i,s=0; for(i=1;i<l0;i+=2) s+=i+1; printf("%dn",s);
A.自然数1~9的累加和
B.自然数1~10的累加和
C.自然数1~9中奇数之和
D.自然数1~10中偶数之和
点击查看答案