网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

【单选题】已知字符0的ASCII码为十六进制的30,下面程序的输出是___________。 main() { union {unsigned char c; unsignedint i[4]; } z; z.i[0]=0x39; z.i[1]=0x36; printf("%cn",z.c);}

A.6

B.9

C.0

D.3


参考答案和解析
B 解析:根据共用体的定义可知:共用体z的成员c和成员i[4]是共用着同一段内存空间,所以,当程序给z.i[0]赋值后,实际上共用体成员c的值也确定了,为0x39,所以在以字符方式打印时,打印结果应是ASCII码等于0x39的字符,即是9。
更多 “【单选题】已知字符0的ASCII码为十六进制的30,下面程序的输出是___________。 main() { union {unsigned char c; unsignedint i[4]; } z; z.i[0]=0x39; z.i[1]=0x36; printf("%cn",z.c);}A.6B.9C.0D.3” 相关考题
考题 有以下程序main(){ char s[]="abcde";s+=2;printf("%d\n",s[0]);}执行后的结果是A) 输出字符 a 的 ASCII 码B) 输出字符 c 的 ASCII 码C) 输出字符 cD) 程序出错

考题 以下程序的输出结果是 ( ) main( ) { union { char i [2]; int k; } r; r. i[0]=2,r.i[1]=0; printf("%d\n",r,k); }A.2B.1C.0D.不确定

考题 有下列程序:main(){char s[]="abcde";s+=2;printf("%d\n",s[0];}执行后的结果是( )。A.输出字符a的ASCII码B.输出字符c的ASCII码C.输出字符cD.程序出错

考题 已知字母a的ASCII码为十进制数97,下面程序的输出结果是()。includemain(){char c1,c2;c 已知字母a的ASCII码为十进制数97,下面程序的输出结果是( )。 #include<stdio.h> main() { char c1,c2; c1='a'+'6'-'0'; c2='a'+'3'-'0'; printf("%c,%c\n",c1,c2); }A.输出无定值B.d,eC.e,fD.g,d

考题 下面程序的输出结果是【】。char b[]="ABCD";main(){char b[30];strcpy(b[0],"GH");strcpy(main(){char b[30];strcpy(b[0],"GH");strcpy(b[1],"GH");strcpy(b[2],"GH");printf("%s\n",b);}

考题 有以下程序:includeunion pw{int i; char ch[2];}a;main(){a.ch[0]=13;a.ch[1]=0;prin 有以下程序: #include<stdio.h> union pw { int i; char ch[2]; }a; main() { a.ch[0]=13;a.ch[1]=0;printf("%d\n",a.i);} 程序的输出结果是( )。A.13B.14C.208D.209

考题 已知在ASCII字符集中,数字0的序号为48,下列程序的输出结果为______。 main() } char a='0',b='9'; printf("%d,%c\n",a,b) ; }A.因输出格式不合法B.48,57C.0,9D.48,9

考题 以下程序的输出结果是( )。 main {int x=0.5;char z=a; printf("%d\n",(x2));}A.0S 以下程序的输出结果是( )。 main {int x=0.5;char z=a; printf("%d\n",(x&1)&&(z2));}A.0B.1C.2D.3

考题 以下程序段的输出结果为()。charastr[5]="1234";char*pstr=astr;printf("%c",pstr[1]-'0'); A.ASCII码值为2的字符B.ASCII码值为1的字符C.2D.1

考题 以下程序的输出结果是______。 main() { union { int i[2]; long j; char m[4]; }r,*s=r; s->i[0]=0x409; s->i[1]=0x407; printf("%d\n",s->m[0]); }A.9B.49C.7D.47

考题 以下程序的输出结果是_______。 main() {union { char i[2]; int k; }r; r.i[0]=2; r.i[1]=0; printf("%d\n",r.k); }A.2B.1C.0D.不确定

考题 已知字符0的ASCⅡ码为十六进制数30,下面程序的输出是______。 main() { int i; union{unsigned char c;unsigned int i[4];}z; z.i[0]=0x39;z.i[1]=0x36; printf("%d\n",z.c); }A.56B.57C.58D.59

考题 已知字符'0'的ASCII码的十进制数为48,并且数组的第0个元素在低位,有以下程序includema 已知字符'0'的ASCII码的十进制数为48,并且数组的第0个元素在低位,有以下程序 #include<stdio.h> 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.39B.9C.38D.8

考题 下列程序的输出结果是______。 main() { union} int a[2]; long k; char c[4]; }un,*sp=un; sp->a[0]=0x39; sp->a[1]=0x38; printf("%1x\n",sp->k); }A.3938B.3839C.390038D.380039

考题 以下程序运行后的输出结果是( )。 include main() {char ch[]="abcd",x[4][4];int i; f 以下程序运行后的输出结果是( )。 include<string.h> main() {char ch[]="abcd",x[4][4];int i; for(i=0;i<4;i++)strcpy(x[i],ch); for(i=0;i<4;i++)printf("%s",x[i][i]); printf("\n"); }

考题 有以下程序: main() { unsigned char a,b; a=4 | 3; b=4 3; printf("%d %d\n",a,b); } 执行后输出结果是( )。A.7 0B.0 7C.1 1D.43 0

考题 字符‘0’的ASCⅡ码的十进制数为48,且数组的第0个元素在低位,则以下程序的输出结果是______。 #include<stdio.h> 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.39B.9C.38D.8

考题 有以下程序 main( ) { unsigned char a,b; a=4|3; b=43; printf(“%d %d\n”,a,b(; } 执行后输出结果是( )A.7 0B.0 7C.1 1D.43 0

考题 已知字符0的ASCII码为十六进制的30,现有程序如下:includemain(){union{ unsigned char 已知字符0的ASCII码为十六进制的30,现有程序如下: #include <stdio.h> main() { union{ unsigned char c; unsigned int i[4]; }z; z.i[0]=0x39; z.i[1]=0x36; printf("%c\n",z.c); } 此程序的输出结果是( )。A.6B.9C.0D.3

考题 下列给定程序中,函数fun()的功能是将字符串s中位于偶数位置的字符或ASCII码为奇数的字符放入字符串t中(规定第一个字符放在第0位中)。例如:字符串中的数据为ADFESHDI,则输出应当是 AFESDI。请改正程序中的错误,使它能得到正确结果。注意;不要改动main函数,不得增行或删行,也不得更改程序的结构。试题程序:include <conio.h>include <stdio.h>include <string.h>define N 80/************found*************/void fun(char s,char t[]){int i,j=0;for(i=0;i<strlen(s);i++)/*********found*+************/if(i%2=0 || s[i]%2!=0)t[j++]=s[i];t[j]='\0';}main(){char s[N],t[N];clrscr();printf("\nPlease enter string s:");gets(s);fun(s,t);printf("\nThe result is:%s\n",t);}

考题 下列程序的执行结果是______。include union {int i;char c[2]; }; void main() {union 下列程序的执行结果是______。 #include<stdio.h> union { int i; char c[2]; }; void main() { union un x; x.c[0]=10; x.c[1]=1; printf("\n%d",x.i); }A.266B.11C.265D.138

考题 下列程序的输出结果是______。include main(){union {int k;char i[2]; }*S,a; s= 下列程序的输出结果是______。#include <stdio.h>main(){ union { int k; char i[2]; } *S,a; s=a; s->i[0]=0x39; s->i[1]=0x38; printf("%x\n",s->k);}A.3839B.3938C.380039D.390038

考题 有以下程序:include main(){unsigned char a,b; a=413; b=43;printf("%d%d\n",a, 有以下程序: #include <stdio.h> main() { unsigned char a,b; a=413; b=43; printf("%d%d\n",a,b); } 执行后的输出结果是( )。A.7 0B.0 7C.1 1D.43 0

考题 有以下程序:includeunion pw{int i; char ch[2]; } a;main(){a.ch[0]=13; a.ch[1]=0; 有以下程序: #include <stdio.h> union pw { int i; char ch[2]; } a; main() { a.ch[0]=13; a.ch[1]=0; printf("%d\n",a.i); } 程序的输出结果是(注意:ch[0]在低字节,ch[1]在高字节)( )。A.13B.14C.208D.209

考题 当执行下面的程序时,其输出结果为______。 union st { int a; char b; } main() { union st s; char *p=(char*)s; s.a=0x3132; s.b=0x33; printf("%c",*p); }A.1B.2C.3D.不确定

考题 下列程序的输出结果是______。 union un { int a[3]; long b; char c[6]; }un1,*p; main() {p=un1; p->a[0]=0x37; p->a[1]=0x38; p->a[2]=0x39; printf("%c\n",p->c[4]); }A.39B.9C.38D.8

考题 数字字符'0'的ASCII值为48,若有以下程序:include main( )char a='1',b ='2';printf( " 数字字符'0'的ASCII值为48,若有以下程序: #include <stdio.h> main( ) char a='1',b ='2'; printf( "% c,",b + + ); printf(" % d \n" ,b - a); } 程序运行后的输出结果是( )。A.3,2B.50,2C.2,2D.2,50

考题 单选题有以下程序 main() { char s[]="abcde"; s+=2; printf("%d/n",s[0]); } 执行后的结果是()A 输出字符a的ASCII码B 输出字符c的ASCII码C 输出字符cD 程序出错