更多"[单选题]有以下程序
#include <stdio.h>
vo"的相关试题:
[单选题]有以下程序
#include
void main()
{
int a[][2]={10,20,30,40,50,60},(*p)[2];
p=a;
printf("%d\n",*(*(p+2)+1));
}
程序运行后的输出结果是 ( )。
A.10
B.20
C.40
D.60
[单选题]有以下程序
#include
void main()
{
int j,a[]={1,3,5,7,9,11,13,15},*p=a+5;
for(j=3;j;j--)
{
switch(j)
{
case 1:
case 2:printf("%d",*p++);
case 3:printf("%d",*(--p));
}
}
}
执行后的输出结果是( )。
A.9911
B.79911
C.99999
D.991113
[单选题]有以下程序
#include
void main()
{ char *alpha[7]={"ABCD","EFGH","IJKL","MNOP","QRST","UVWX","YZ"};
char **p;
int i;
p=alpha;
for(i=0;i<4;i++)
printf("%c",*(p[i]));
printf("\n");
}
执行后的输出结果是( )。
A.AEIM
B. BFJN
C.ABCD
D. DHLP
[单选题]有以下程序
#include
void main ( )
{ int a[]={1, 2, 3, 4, 5} ;
int x, y, *p;
p=&a[0];
x=*(p+2);
y=*(p+4);
printf("%d,%d,%d\n", *p, x, y);
}
执行后的输出结果是( )。
A.1,3,5
B.1,2,3
C.1,2,4
D.1,4,5
[单选题]有以下程序
#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 "stdio.h"
void main()
{ int x=0x02ff,y=0x0ff00;
printf("%d\n",(x&y)>>4|0x005f);
}
执行后的输出结果是( )。
A.127
B.255
C.128
D.1
[单选题]有以下程序
#include "stdio.h"
void main()
{ char s[12]= "a book";
printf("%.4s",s);
}
执行后的输出结果是( )。
A.a book!
B.a book![四个空格]
C.a bo
D.格式描述错误,输出不确定
[单选题]有以下程序
#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