更多"[单选题]有以下程序
#include 'stdio.h'
#inc"的相关试题:
[单选题]有以下程序
#include "stdio.h"
#include "string.h"
void main( )
{ char s1[50]={"some string *"},s2[]={"test"};
printf("%s\n", strcat(s1,s2));
}
执行后的输出结果是( )。
A.some string
B.test
C. some stritest
D. some string *test
[单选题]有以下程序
#include "stdio.h"
#include
void main()
{ float x,y,z;
scanf("%f,%f",&x,&y);
z=x/y;
while(1)
{ if(fabs(z)>1.0)
{ x=y;
y=z;
z=x/y;
}
else break;
}
printf("%f\n",y);
}
通过键盘输入3.6,2.4,执行后的输出结果是( )。
A.1.5
B.1.6
C.2
D.2.4
[单选题]有以下程序
#include
#include
void fun(char *w,int m)
{char s,*p1,*p2;
p1=w;p2=w+m-1;
while(p1
A.654321
B.116611
C.161616
D.123456
[单选题]有以下程序
#include "stdio.h"
void change(int k[ ]){ k[0]=k[5]; }
void main()
{ int x[10]={1,2,3,4,5,6,7,8,9,10},n=0;
while( n<=4 ) { change( &x[n]) ; n++; }
for(n=0; n<5; n++) printf("%d ",x[n]);
printf("\n");
}
程序运行后输出的结果是( )。
A.6 7 8 9 10
B.1 3 5 7 9
C.1 2 3 4 5
D.6 2 3 4 5
[单选题]以下程序输出结果是 。
#include "stdio.h"
void f ();
main()
{int a;
for(a=1;a<=3;a++)
fun();
}
void fun()
{static int i=1;
i+=3;
printf("%2d",i);
}
A.4 7 10
B.4 4 4
C.4 5 6
D.4 6 8
[单选题]有以下程序
#include “stdio.h”
void main()
{ int x, y, z;
x=y=1;
z=x++,y++,++y;
printf("%d,%d,%d\n",x,y,z);
}
程序运行后的输出结果是( )。
A.1,2,3
B.1,3,2
C.2,3,1
D.3,1,2
[单选题]有以下程序
#include
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));
}
程序运行后的输出结果是()。
A.1,2
B.4,1
C. 3,4
D.2,3
[单选题]有以下程序
#include
struct S
{ int a,b;}data[2]={10,100,20,200};
main()
{ struct S p=data[1];
printf("%d\n",++(p.a));
}
程序运行后的输出结果是()。
A.10
B.11
C.20
D.21
[单选题]有以下程序
#include "stdio.h"
void main()
{ char s[12]= "a book";
printf("%.4s",s);
}
执行后的输出结果是( )。
A.a book!
B.a book![四个空格]
C.a bo
D.格式描述错误,输出不确定
[单选题]有以下程序
#include
void main()
{ int s;
scanf("%d",&s);
while(s>0)
{ switch(s)
{ case 1:printf("%d",s+5);
case 2:printf("%d",s+4); break;
case 3:printf("%d",s+3);
default:printf("%d",s+1);break;
}
scanf("%d",&s);
}
}
运行时,若输入1 2 3 4 5 0<回车>,则输出结果是( )。
A.6566456
B.66656
C.66666
D.6666656
[单选题]有以下程序
#include "stdio.h"
void main()
{ union
{ int i[2];
long k;
char c[4];
}r,*s=&r;
s->i[0]=0x39;
s->i[1]=0x38;
printf("%c\n",s->c[0]);
}
执行后的输出结果是( )。
A.39
B.9
C.38
D.8
[单选题]有以下程序
#include "stdio.h"
void 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;
}
printf("a=%d,b=%d\n",a,b);
}
执行后的输出结果是( )。
A.a=2,b=1
B.a=1,b=1
C.a=1,b=0
D.a=2,b=2