单项选择题

有一函数
以下程序段中不能根据x值正确计算出y值的是 A) if(x>0) y=1; else if(x==0) y=0; else y=-1; B ) y=0; if(x>0) y=1; else if(x<0) y=-l; 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=-l;

<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序 struc t STU{ char name [10] int num; void f1(struct STU c) { struct STU b={ LiSiGuo ,2042}; c=b; } void f2(struct STU *c) { struct STU b={ SunDan ,2044); *c=b; } main ( ) { struct STU a={ YangSan ,2041},b={ WangYin ,2043}; f1 (a); f2 (&b); printf ( %d %d n ,a.num,b.num); } 执行后输出结果是
A.2041 2044
B.2041 2043
C.2042 2044
D.2042 2043
单项选择题
有以下程序 void swapl(int c0[],int c1[] { int t; t=c0[0]; c0[0]=c1[0]; c1[0]=t; } void swap2 (int *c0,int *c1) { int t; t-*c0; *c0=*c1; *c1=t; } main() { int a[2]={3,5}, b[2]={3,5} swapl(a,a+1); swap2(&b[0],&b[1]); printf( %d %d %d %d n ,a[0],a[1],b[0],b[1]); } 程序运行后的输出结果是
A.3 5 5 3
B.5 3 3 5
C.3 5 3 5
D.5 3 5 3
相关试题
  • 以下程序运行后的输出结果是______。...
  • 设有如下定义#define MYSWAP(z,x,y)...
  • 以下程序中函数huiwen 的功能是检查一个字...
  • 以下程序运行后的输出结果是______。...
  • fun函数的功能是:首先对a所指的N行N列的矩...