有以下计算公式:
若程序前面已在命令行中包括math.h文件,不能够正确计算上述公式的程序是()。
A. if(x>=0)y=sqrt(x);
B. y=sqrt(x); else y=sqrt(-x); if(x<0)y=sqrt(-x);
C. if(x>=0)y=sqrt(x);
D. y=sqrt(x>=0? x:-x);
查看答案
有以下程序: #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
以下scanf函数调用语句中对结构体变量成员的引用不正确的是
struct pupil
{ char name[20];
int age
int sex;
} pup[5],*p;
p=pup;
A. scanf("%s",pup[0].name);
B. scanf("%d",&pup[0].age);
C. scanf("%dT",&(p->sex));
D. scanf("%d",p->age);
有以下程序: #include<stdio.h> void fun(char**p) { ++P;printf("%s\n",*p);} main() char*a[]={"Morning","Afternoon","Evening","Night"}; fun(A); } 程序的运行结果是()。
Afternoon
B. fternoon
C. Morning
D. oring
以下结构体类型说明和变量定义中正确的是()。
A. typedef struct
B. struct REC; {int n;char c;}REC; {int n;char c;}; REC t1,t2; REC t1,t2;
C. typedef struct REC;
D. struct {int n=0;char c='A';}t1,t2; {int n;char c;}REC; REC t1,t2;