二级C语言
第461题
有如下程序段:
int i,n;
for(i=0;i<8;i++)
{
n=rand()%5;
switch(n)
{
case 1:
case 3:printf("%d\n",n); break;
case 2:
case 4:printf("%d\n",n); continue;
case 0:exit(0);
}
printf("%d\n",n);
}如下有关程序段执行状况的论述,正确的是( )
第462题
有如下程序:
#include<stdio.h>
main()
{
char s[]="012xy\08s34f4w2";
int i,n=0;
for(i=0;s[i]!=0;i++)
if(s[i]>= "0"&&s[i]<= "9")n++;
printf("%d\n",n);
}程序运营后的输出成果是( )
第463题
若i和k都是int类型变量,有如下for语句:
for(i=0,k=1;k=1;k++)
printf("*****\n");下面有关语句执行状况的论述中正确的是( )
第464题
有如下程序:
#include<stdio.h>
main()
{
char b,c;
int i;
b="a";
c="A";
for(i=0;i<6;i++)
{
if(i%2)putchar(i+b);
else putchar(i+c);
}
printf("\n");
}程序运营后的输出成果是( )
第465题
设有定义:double x[10],*p=x;,如下能给数组x下标为6的元素读入数据的正确的语句是( )
第466题
有如下程序(阐明:字母A的ASCII码值是65)
#include<stdio.h>
void fun(char *s)
{
while(*s)
{
if(*s%2)
printf("%c",*s);
s++;
}
}
main()
{
char a[]="BYTE";
fun(a);
printf("\n");
}程序运营后旳输出成果是( )
第467题
有如下程序段:
#include<stdio.h>
main()
{
…
while(getchar()!="\n");
…
}如下论述中正确的是( )
第468题
有如下程序:
#include<stdio.h>
main()
{
int x=1,y=0;
if(!x) y++;
else if(x==0)
if (x) y+=2;
else y+=3;
printf("%d\n",y);
}程序运营后的输出成果是( )
第469题
若有定义语句:char s[3][10],(*k)[3],*p;,则如下赋值语句正确的是( )
第470题
有如下程序:
#include<stdio.h>
void fun(char *c)
{
while(*c)
{
if(*c>="a"&&*c<="z")
*c=*c-("a"-"A");
c++;
}
}
main()
{
char s[81];
gets(s);
fun(s);
puts(s);
}当执行程序时从键盘上输入Hello Beijing〈回车〉,则程序的输出成果是( )
第471题
如下函数的功能是:通过键盘输入数据,为数组中的所有元素赋值。
#include<stdio.h>
#define N 10
void fun(int x[N])
{
int i=0;
while(i<N)
scanf("%d", );
}在程序中下划线处应填入的是( )
第472题
有如下程序:
#include<stdio.h>
main()
{
char a[30],b[30];
scanf("%s",a);
gets(b);
printf("%s\n %s\n",a,b);
}程序运营时若输入:
how are you? I am fine〈回车〉
则输出成果是( )
第473题
设有如下函数定义:
int fun(int k)
{
if (k<1) return 0;
else if(k==1) return 1;
else return fun(k-1)+1;
}若执行调用语句:n=fun(3);,则函数fun总共被调用的次数是( )
第474题
有如下程序:
#include<stdio.h>
int fun(int x,int y)
{
if(x!=y) return((x+y)/2);
else return(x);
}
main()
{
int a=4,b=5,c=6;
printf("%d\n",fun(2*a,fun(b,c)));
}程序运行后的输出成果是( )
第475题
有如下程序:
#include<stdio.h>
int fun()
{
static int x=1;
x*=2;
return x;
}
main()
{
int i,s=1;
for(i=1;i<=3;i++)s*=fun();
printf("%d\n",s);
}程序运营后的输出成果是( )
第476题
有如下程序:
#include<stdio.h>
#define S(x) 4*(x)*x+1
main()
{
int k=5,j=2;
printf("%d\n",S(k+j));
}程序运营后的输出成果是( )
第477题
设有定义:struct {char mark[12];int num1;double num2;}t1,t2;,若变量均已对的赋初值,则如下语句中错误的是( )
第478题
有如下程序:
#include<stdio.h>
struct ord
{
int x,y;
}
dt[2]={1,2,3,4};
main()
{
struct ord *p=dt;
printf("%d,",++(p->x));
printf("%d\n",++(p->y));
}程序运营后的输出成果是( )
第479题
有如下程序:
#include<stdio.h>
struct S
{
int a,b;
}
data[2]={10,100,20,200};
main()
{
struct S p=data[1];
printf("%d\n",++(p.a));
}程序运营后的输出成果是( )
第480题
有如下程序:
#include<stdio.h>
main()
{
unsigned char a=8,c;
c=a>>3;
printf("%d\n",c);
}程序运营后的输出成果是( )