若有说明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
以下能表示a和b同时为正或同时为负的逻辑表达式是()。
A)(a>=0||b>=0)&&(a<0||b<0)
B)a>=0&&b>=0)&&(a<0&&b<0)
C)(a+b>0)&&(a+b<=0)
D)a*b>0