A)操作数乘以2
B)操作数除以2
C)操作数乘以4
D)操作数除以4
(40)有以下结构体说明和变量的定义,且指针p指向变量a,指针q指向变量b。则不能把结点b连接到结点a之后的语句是
struct node
{ char data;
struct node *next;
} a,b,*p=&a,*q=&b;
A)a.next=q;
B)p.next=&b;
C)p-》next=&b;
D)(*p).next=q;
(41)下面程序的输出结果是
struct st
{ int x;
int *y;
} *p;
int dt[4]={10,20,30,40};
struct st aa[4]={50,&dt[0],60,&dt[1],70,&dt[2],80,&dt[3]};
main()
{ p=aa;
printf(“%d\n”,++p-》x);
printf(“%d\n”,(++p)-》x);
printf(“%d\n”,++(*p-》y));}
A)10
20
20
B)50
www.lexue88.com
60
21
C)51
60
21
D)60
70
31
(42)下面程序的输出结果是
#include《stdio.h》
#include《string.h》
main()
{char *p1=“abc”,*p2=“ABC”,str[50]= “xyz”;
strcpy(str+2,strcat(p1,p2));
printf(“%s\n”,str);}
A)xyzabcABC
B)zabcABC
C)xyabcABC
D)yzabcABC
(43)以下程序的输出结果是
long fun( int n)
{ long s;
if(n==1||n==2)s=2;
else s=n-fun(n-1);
return s;}
main()
{ printf(“%ld\n”, fun(3)); }
A)1
B)2
C)3
D)4
(44)以下所列的各函数首部中,正确的是
A)void play(var :Integer,var b:Integer)
B)void play(int a,b)
C)void play(int a,int b)
D)Sub play(a as integer,b as integer)
(45)不合法的main函数命令行参数表示形式是
A)main(int a,char *c[])
B)main(int arc,char **arv)
C)main(int argc,char *argv)
D)main(int argv,char *argc[])
(46)有如下程序
main()
{char ch[2][5]={“6937”,“8254”},*p[2];
int i,j,s=0;
for(i=0;i《2;i++)p[i]=ch[i];
for(i=0;i《2;i++)
for(j=0;p[i][j]》′\0′;j+=2)
s=10*s+p[i][j]-′0′;
printf(“%d\n”,s);}
该程序的输出结果是
A)69825
B)63825
C)6385
D)693825
(47)以下程序的输出结果是
union myun
{struct
{ int x, y, z; } u;
int k;} a;
main()
{a.u.x=4; a.u.y=5; a.u.z=6;
a.k=0;
printf(“%d\n”,a.u.x);}
A)4
B)5
C)6
D)0
(48)以下程序的输出结果是
main()
{ char x=040;
printf(“%o\n”,x《《1);}
A)100
B)80
C)64
D)32
(49)C 语言中,系统的标准输入文件是指
A)键盘
B)显示器
C)软盘
D)硬盘
(50)下面的程序执行后,文件test中的内容是
#include 《stdio.h》
void fun(char *fname,char *st)
{ FILE *myf; int i;
myf=fopen(fname,“w” );
for(i=0;i《strlen(st); i++)fputc(st[i],myf);
fclose(myf);}
main()
{ fun(“test”,“new world”); fun(“test”,“hello,”);}
A)hello,
B)new worldhello,
C)new world
D)hello, rld
,2017计算机二级考试C语言考前密卷五tag: 计算机等级考试,计算机等级考试试题,全国计算机等级考试试题,计算机等级考试