选择题 以下程序的运行结果是______。
#include'stdio.h'
main()
{struct date
{int year,month,day;}today;
printf('%d\n',sizeof(struct date));
}
选择题 有以下程序
#include<stdio.h>
int fun()
{ static int x=1;
x*=2; return x;
}
main()
{ int i,s=1;
for(i=1;i<=2;i++) s=fun();
printf('%d\n',s);
}
程序运行后的输出结果是______。
选择题 有如下程序:
#include <stdio.h>
main()
{
int i,k;
int array[4][2]={{1,2},{4,9},{6}};
for(i=0;i<2;i++)
for(k=0;k<4;k++)
printf('%d,',array[k][i]);
printf('\n');
}
程序运行后的输出结果是______。
选择题 下列叙述中错误的是______。
选择题 若有说明和语句:char str[]='Hello',*p;p=str;,则此时*(p+5)中的值为______。
选择题 有以下程序
#include<stdio.h>
main()
{int y=9;
for(;y>0;y--)
if(y%3==0)printf('%d',--y);
}
程序的运行结果是______。
选择题 有以下程序:
#include <stdio.h>
typedef struet stu{
char name[10];
char gender;
int score;
}STU;
void f(STU a,STU *b,STU c)
{ $b=c=a;
printf('%s,%c,%d,',b->name,b->gender,b->score);
printf('%s,%c,%d,',c.name,c.gender,c.score);
}
main()
{ STU a={'Zhao','m',290},b={'Qian','f',350},c={'Sun','m',370};
f(a,b,c);
printf('%s,%c,%d,',b.name,b.gender,b.score);
printf('%s,%c,%d\n',c.name,c.gender,c.score);
}
程序运行后的输出结果是
选择题 下列叙述中正确的是______。
选择题 有以下程序:
#include<stdio.h>
main()
{ int a, b, k, m, *p1, *p2;
k=1, m=8;
p1=k, p2=m;
a=/*p1-m; b=*p1+*p2+6;
printf('%d', a); printf('%d\n', b);
}
编译时编译器提示错误信息,你认为出错的语句是______。
选择题 若有以下程序
#include<stdio.h>
void sp(int *a)
{ int b=2;
a=b;*a=*a*2; printf('%d,',*a);
}
main()
{ int k=3,*p=k;
sp(p); printf('%d,%d\n',k,*p);
}
则程序的输出结果是______。
选择题 下列标识符不是关键字的是______。
选择题 以下不合法的数值常量是______。
选择题 有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数):
# include <stdio.h>
# include <string.h>
main()
{ char a[10]='abc',b[10]='012',c[10]='xyz';
strcpy(a+1,b+2);
puts(strcat(a,c+1));
}
程序运行后的输出结果是______。
选择题 有如下程序:
#include <stdio.h>
main()
{
int i,data;
scanf('%d',data);
for(i=0;i<5;i++)
{ if(i>data)break;
printf('%d,',i);
}
printf('\n');
}
程序运行时,从键盘输入:3<回车>后,程序输出结果为______。
选择题 有以下程序:
#include <stdio.h>
void f(int x[],int n)
{ if(n>1)
{ f(x[1], n-1);
printf('%d,',x[0]);
}
else
printf('%d,',x [0]);
}
main()
{int z[6]={1,2,3,4,5,6};
f(z,6); printf('\n');
}
程序的运行结果是______。
选择题 有以下程序
#include<stdio.h>
main()
{int m=1, n=2, *p=m, *q=n, *r;
r=p; p=q; q=r;
printf('%d, %d, %d, %d\n', m, n, *p, *q);
}
程序运行后的输出结果是______。
选择题 有以下程序
#include <stdio.h>
main()
{ FILE *fp;
int a[10]={1,2,3,0,0},i;
fp=topen('d2.dat','wb');
fwrite(a,sizeof(int),5,fp);
fwrite(a,sizeof(int),5,fp);
fclose(fp);
fp=fopen('d2.dat','rb');
fread(a,sizeof(int),10,fp);
fclose(fp);
for(i=0;i<10;i++)
printf('%d,',a[i]);
}
程序的运行结果是______。
选择题 C语言中运算对象必须是整型运算符的是
选择题 设a和b均为int型变量,且a=6,b=11,则能使值为3的表达式是______。
选择题 以下程序用来统计文件中字符的个数(函数feof用以检查文件是否结束,结束时返回非零):
#include <stdio.h>
main()
{ FILE *fp;long num=0;
fp=fopen('fname.dat','r');
while(______){ fgetc(fp);num++;}
printf('num=%d\n',num);
fclose(fp);
}
下面选项中,填入横线处不能得到正确结果的是______。