题目内容

以下程序的输出是()#include viod main(){int i,j,k,a=3,b=2;i=(--a==b++)?--a:++b;j=a++;k=b;printf("i=%d,j=%d,k=%d\n",i,j,k);}

A. i=2,j=1,k=3
B. i=1,j=1,k=2
C. i=4,j=2,k=4
D. i=1,j=1,k=3

查看答案
更多问题

以下错误的if语句是()

A) if(x>y);
B) if (x==y) x+=y;
C) if (x!=y) scanf(“%d”,&x) else scanf(“%d”,&y)
D) if (x

若有说明int x,y;不能实现以下函数关系的程序是()y=-1 (x<0)y=0 (x=0)y=1 (x>0)

A) if (x<0) y=-1;else if(x==0) y=0; else y=1;
B) y=-1;if (x!=0)if(x>0) y=1;else y=0;
C. y=0; if (x>=0) {if (x>0) y=1;}else y=-1;
D. if(x>=0) if(x>0) y=1; else y=0;else y=-1;

等级为A,score=100;等级为B,score=190;等级为C或D,score=60;其他,score=0.if语句,以下正确的是 ( )。

A. a) if(grade='A') score=100; else if(grade='B') score=90; else if(grade='C'||grade='D') score=60; else score=0;
B. b) if(grade=='A') score=100; if(grade=='B') score=90; if(grade=='C'||grade=='D') score=60; else score=0;
C. c) if(grade=='A') score=100; else if(grade=='B') score=90; else if(grade=='C') score=60; else if(grade=='D') score=60; else score=0;
D. d) if(grade=='A') score=100; else if(grade=='B') score=90; else if(grade=='C'&&grade=='D') score=60; else score=0;

给定某C程序片断,如下:int i = 1;int j = i++;if((i > ++j) && (i++ == j))i += j;printf(i);该程序运行后,i的输出结果是( )。

A. a) 1
B. b) 2
C. c) 3
D. d) 4

答案查题题库