单选题有以下程序:#include main(){ char *a[]={abcd,ef,gh,ijk}; int i; for(i=0;i4;i++)printf(%c,*a[i]);}程序运行后的输出结果是(  )。AaegiBdfhkCabcdDabcdefghijk

单选题
有以下程序:#include main(){ char *a[]={abcd,ef,gh,ijk}; int i; for(i=0;i<4;i++)printf(%c,*a[i]);}程序运行后的输出结果是(  )。
A

aegi

B

dfhk

C

abcd

D

abcdefghijk


参考解析

解析:
char *a[]定义了一个指向数组的指针。由题中初始化结果得:*a[0]="abcd",a[1]="ef",a[2]="gh",a[3]="ijk",但是在输出语句时要求输出的格式是%c,为一个字符,所以每个元素输出第一个字符,即aegi。答案选择A选项。

相关考题:

下面程序段的运行结果是()。(注:└┘代表空格)include "stdio.h"main(){ char s[6]s="abcd"printf("\"%s\"\n", s)} A."abcd"B."abcd└┘"C.\"abcd\"D.编译出错

有以下程序#include stdio.hmain(){ char *a[]={"abcd","ef","gh","ijk"};int i;for(i=0;i4;i++) printf("%c",*a[i]);}程序运行后的输出结果是A)aegiB)dfhkC) abc dD)abcdefghijk

(31)有以下程序#include stdio.hmain(){ char *a[ ]={“abcd”,”ef”,”gh”,”ijk”};int I;for (i=0;i4;i++) printf(“%c”,*a);}程序运行后输出的结果是A)aegi B)dfhk C)abcd D)abcdefghijk

有以下程序 include main(){FILE *fp;int i; char ch[]="abcd",t; fp=fopen("abc.dat" 有以下程序 #include <stdio.h> main() {FILE *fp; int i; char ch[]="abcd",t; fp=fopen("abc.dat","wb++"); for(i=O;i<4;i++)fwrite(ch[i],1,1,fp); fseek (fp,-2L,SEEK_END); fread (t,1,1,fp); fclose (fp); printf ("%c\n",t); } 程序执行后的输出结果是______。A.dB.cC.bD.a

有以下程序:includevoid fun(char**p){++P;printf("%s\n",*p);}main()char*a[]={"Morn 有以下程序: #include<stdio.h> void fun(char**p) { ++P;printf("%s\n",*p);} main() char*a[]={"Morning","Afternoon","Evening","Night"}; fun(A); } 程序的运行结果是( )。A.AfternoonB.fternoonC.MorningD.oring

下面程序的输出结果是【】。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);}

在执行以下程序时,如果从键盘上输入ABCdef,则输出为______。include main(){char 在执行以下程序时,如果从键盘上输入ABCdef<回车>,则输出为______。#include <stdio.h>main (){ char ch; while ((ch=getchar())!="\n") { if (ch>='A' ch<='B')ch=ch+32; else if (ch>='a' ch<='z')ch=ch-32; printf("%c",ch); } printf("\n");}A.ABCdefB.abcDEFC.abcD.DEF

有以下程序: include point ( char * p) {p + = 3; }main( ) char b[4] = {'a','b','c 有以下程序: #include <stdio.h>point ( char * p) { p + = 3; }main( ) char b[4] = {'a','b','c','d'} , *p=b; point(p); printf( "% c \n" , * p);A.aB.bC.cD.d

以下程序输出的结果是includeincludemain(){ char w[][10]={"ABCD","EFGH" 以下程序输出的结果是 #include<stdio.h> #include<string.h> main() { char w[][10]={"ABCD","EFGH","IJKL","MNOP"},k; for(k=1;k<3;k++) printf("%s\n",w[k][k]);}A.ABCD FGH KLB.ABC EFG U MC.EFG JK OD.FGH KL

下面程序的输出结果是( )。 include main() {static char a[]="china"; char*ptr=a; whi 下面程序的输出结果是( )。 include<stdio.h> main() {static char a[]="china"; char*ptr=a; while(*ptr) {printf("%c",*ptr-32); ptr++; } }

有以下程序: include main ( ){char s[] = "ABCD", * p;for(p=s+1;p 有以下程序: #include < stdio. h > main ( ) { char s[] = "ABCD", * p; for(p=s+1;p<s+4;p++) pfintf(" % s \n" ,p); }A.ABCD BCD CD DB.A B CC.B C DD.BCD CD D

有以下程序 include void fun(char **p) { ++p; printf("%s\n",*p); 有以下程序 #include <stdio.h> void fun(char **p) { ++p; printf("%s\n",*p); } main() { char *a[]={"Moming","Afternoon","Evening","Night"}; fun(a); } 程序的运行结果是A.AfternoonB.fternoonC.MorningD.orning

有以下程序:include include main( ) {char a[ 7 ] = "a0 \0a0 \0";int i, 有以下程序:#include <stdio.h>#include <string.h>main( ) { char a[ 7 ] = "a0 \0a0 \0"; int i,j; i = sizeof(a); j = strlen(a); printf(" % d %d \n" ,i,j); }程序运行后的输出结果是( )。A.22B.76C.72D.62

有以下程序: include main( ) {char s[ ] ="159" , * p;p=s;printf( "% c", * p + + 有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。A.15B.16C.12D.59

有以下程序includemain(){char*a[]={"abcd","ef","gh","ijk"};int i; for(i=0;i 有以下程序 #include<stdio.h> main() { char*a[]={"abcd","ef","gh","ijk"}; int i; for(i=0;i<4;i++) printf("%c",*a[i]); } 程序运行后的输出结果是______。A.ageiB.dfhkC.abcdD.abcdefghijk

以下程序的输出结果是【】。 include main() {struct stru {int a; float b; char d[4]; } 以下程序的输出结果是【 】。include<stdio.h>main(){ struct stru{ int a;float b;char d[4];};printf("%d\n",sizeof(struct stru));}

有以下程序 include main() { char a=4; printf("%d/n,a=a 有以下程序 #include <stdio.h> main() { char a=4; printf("%d/n,a=a<<1); } 程序的运行结果是______。A.40B.16C.8D.4

以下程序:includeincludemain(){char str[]="abcd\n\123\xab";printf("%d" 以下程序: #include<stdio.h> #include<string.h> main() {char str[]="abcd\n\123\xab"; printf("%d",(str)); } 运行后的输出结果是( )。A.10B.9C.7D.14

有以下程序:include include using namespace std;int main ( ){ ofstream 有以下程序: #include <iostream> #include <fstream> using namespace std; int main ( ) { ofstream ofile; char ch; ofile.open ("abc.txt"); cin>>ch; while (ch!='#' ) { cin>>ch; ofile.put(ch);A.程序编译时出错B.abc#C.abcD.#

有下列程序:#includestdi0.hvoidmain(){char*a[]={abcd,ef,gh,ijk);inti;for(i=0;i4;i++)printf(%C,*a[i]);}程序运行后的输出结果是( )。A.aegiB.dfhkC.abcdD.abcdefghijk

以下程序段的输出结果是 ______。includevoid main(){ char*p[5]={"ABCD","EF","GHI 以下程序段的输出结果是 ______。 #include<iostream.h> void main(){ char*p[5]={"ABCD","EF","GHI","JKL","MNOP"}; char **q=p; int i; for(i=0;i<=4;i++) cout<<q[i]; }A.ABCDEFGHIJKLB.ABCDC.ABCDEFGHIJKMNOPD.AEGJM

下面程序的运行结果是 ( ) include include main( ) { char * a=" 下面程序的运行结果是 ( ) # include<stdio.h> # include<string.h> main( ) { char * a="AbcdEf",* b="aBcD" a + +;b + +; printf("%d\n",strcmp(a,b)); }A.0B.负数C.正数D.无确定值

有以下程序:include main( ){char P[] = {'a','b','c'} ,q[]: "abc";printf( "% d % d 有以下程序:#include <stdio.h>main( ){ char P[] = {'a','b','c'} ,q[]: "abc"; printf( "% d % d \ n", sizeof(p), sizeof(q) );}程序运行后的输出结果是( )。A.44B.33C.34D.43

有下列程序: #includestdi0.h voidmain() {char*a[]={"abcd","ef","gh","ijk");inti; for(i=0;i4;i++)printf("%C",*a[i]); } 程序运行后的输出结果是( )。A.aegiB.dfhkC.abcdD.abcdefghijk

有以下程序:include char fun(char x,char y){if(x 有以下程序: #include <stdio.h> char fun(char x,char y) { if(x<y) return x; return y; } main() { int a='9',b='8',c='7'; printf("%c\n",fun(fun(a,b),fun(b,c))); } 程序的执行结果是( )。A.函数调用出错B.8C.9D.7

有以下程序:include include main(){char *p[10]={"abc","aabdfg","dcdbe" 有以下程序: #include <stdio.h> #include <string.h> main() { char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"}; printf("%d\n",strlen(p[4])); } 执行后的输出结果是( )。A.2B.3C.4D.5

单选题有以下程序(strcat函数用以连接两个字符串):#include #include main(){ char a[20]=ABCD\0EFG\0, b[]=IJK; strcat(a,b); printf(%s,a);}程序运行后的输出结果是(  )。AABCDE\0FG\0IJKBABCDIJKCIJKDEFGIJK

单选题有以下程序:#include main(){ char *a[]={abcd,ef,gh,ijk}; int i; for(i=0;i4;i++)printf(%c,*a[i]);}程序运行后的输出结果是(  )。AaegiBdfhkCabcdDabcdefghijk