单选题有以下程序#include void fun(char **p){ ++p; printf(%s,*p);}main(){ char *a[] = {Morning, Afternoon, Evening, Night}; fun(a);}程序的运行结果是(  )。AAfternoonBflemoonCMorningDoming

单选题
有以下程序#include void fun(char **p){ ++p; printf(%s,*p);}main(){ char *a[] = {Morning, Afternoon, Evening, Night}; fun(a);}程序的运行结果是(  )。
A

Afternoon

B

flemoon

C

Morning

D

oming


参考解析

解析:
用字符串数组a给形参p赋初始值,p指向a[0],在函数fun中执行++p,则p指向a[1],程序运行结果是Afternoon。答案选择A选项。

相关考题:

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

有以下程序void fun1(char *p){ char *q;q=p;while(*q!='\0'){ (*q)++; q++; ) }}main(){ char a[]={"Program"),*p;p=a[3];fun1(p);printf(" % s\n",a);}程序执行后的输出结果是A)ProhsbnB)PrphsbnC)ProgsbnD)Program

请补充函数fun(),该函数的功能是:依次取出字符串中所有的小写字母以形成新的字符串,并取代原字符串。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。试题程序:include<stdio.h>include<conio.h>void fun(char *s){int i=0;char *p=s;while(【 】){if (*p>='a'*p<='z'){s[i]=*p;【 】;}p++;}s[i]=【 】;}main(){char str[80];clrscr();printf("\nEnter a string:");gets(str);printf("\n\nThe string is:\%s\n",str);fun(str);printf("\n\nThe string of changingis:\%s\n",str);}

有以下程序: void fun1(char*p) {char*q; q=P; while(*q!='\0') { (*q)++;q++;} } main() {char a[]={"Program"),*p; p=&a[3];funl(p);printf("%s\n",A); } 程序执行后的输出结果是( )。A.ProhsbnB.PrphsbnC.ProgsbnD.Program

有以下程序: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

有以下程序: includemain(){char*p,*q; p=(char *)malloc(sizeof(char)* 20);q=p; sca 有以下程序: # include<stdio.h> main() { char*p,*q; p=(char *)malloc(sizeof(char)* 20);q=p; scanf("%s %s",p,q);printf("%s %s\n",p,q); } 若从键盘输入;abc def<回车>,则输出结果是 ______。A.def defB.abc defC.abe dD.d d

有以下程序:includeincludeincludevoid f(char*s,char*t){char k;k=*s; * 有以下程序: #include<stdio.h> #include<string.h> #include void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++;t--; if(*s)f(s,t): } main() {char str[10]="abcdefg",*P; P=str+strlen(str)/2+1: f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是( )。A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg

有以下程序: 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

有以下程序: include void funl (char * p){char * q; q=p; while( *q! ='\0') } (*q) 有以下程序: #include <stdio.h>void funl (char * p){ char * q; q=p; while( *q! ='\0') } (*q) ++;q++;}mains( ){ char a[ ] = { "Program" } , * p; p = a[3]; fun1 (p); printf("% s \n" ,a);}程序执行后的输出结果是( )。A.ProhsbnB.PrphsbnC.ProgsbnD.Program

有以下程序: include void f(char *s,char *t) {char k; k=*s; +s=*t; 有以下程序: #include<string.h> void f(char *s,char *t) {char k; k=*s; +s=*t; *t=k; S++; t--; if(*s) f(s,t); } main() {char.str[10]="abcdefg",*p; p=str+strlen(str) /2+1; f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是 ______。A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg

有以下程序 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 void fun(int n, int *p) { int f1,t2; if(n==1 | 有以下程序 #include <stdio.h> void fun(int n, int *p) { int f1,t2; if(n==1 ||n==2) *p=1; else { fun(n-1,f1); fun(n-2,f2); *p=f1+f2; } } main() { int s; fun(3,s); printf("%d\n", s ); }A.2B.3C.4D.5

有以下程序: 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

有以下程序#include stdio.hvoid fun(char **p){ p=p+2; printf("%s\n",*p);}main(){ char *a[]={"Morning","Afternoon","Evening","Night"}; fun(a);}程序的运行结果是A.rningB.afternoonC.ternoon D.Evening

有以下程序 include include int fun(int n) {int * 有以下程序 #include <stdio.h> #include <stdlib.h> int fun(int n) {int *p; p=(int*)malloc(sizeof(int)); *p=n; return *p; } { int a; a=fun(10); printf("%d\n",a+fun(10)); } 程序的运行结果是______。A.0B.10C.20D.出错

请读程序: includde include void fun(char * s) {char a[10]; str 请读程序: # includde<stdio.h> # include<string.> void fun(char * s) {char a[10]; strcpy(a,"STRING"); s=a; } main() { char*p; fun(p); print{("%s\n",p); } 上面程序的输出结果(表示空格) ( )A.STRINGB.STRINGC.STRINGD.不确定的值

以下程序的输出结果是()。includeint fun (char*s){char *p=s;while (*p!='\0,) p++ 以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }A.3B.6C.8D.0

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

以下程序运行后,输出结果是()includess(char*s){char*p=s; while(*p)p++ return(p-s); 以下程序运行后,输出结果是( ) #include<stdio.h> ss(char *s) { char*p=s; while(*p) p++ return(p-s); } main() { char *a="abded" int i; i=ss(a) ; printf("%d\n",i); }A.8B.7C.6D.5

有以下程序: include include void f(char * s,char*t){char k; k=*s;*s=* 有以下程序: #include <stdio.h>#include <string.h>void f(char * s,char*t){ char k; k=*s; *s=*t; *t=k; s++; t--; if( * s) f(s,t);}main( ){ char str[10] :"abedefg", * p; p = str + strlen(str)/2+1; f(p,p -2); printf( "% s \n" ,str);程序运行后的输出结果是( )。A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg

有以下程序: include void fun(char(*p)[6]) { int i; for(i=0;i 有以下程序: #include void fun(char(*p)[6]) { int i; for(i=0;iA.Aa1FB.Ab3IC.ABCDD.fghij

有以下程序:includevoid fun(char *a, char *b){ a=b;(*a)++;}main(){char c1='A',c2= 有以下程序: #include <stdio.h> void fun(char *a, char *b) { a=b; (*a)++;} main() { char c1='A',c2='a',*p1,*p2; p1=c1; P2=c2; fun(p1,p2); printf("%c%c\n",c1,c2); } 程序运行后的输出结果是( )。A.AbB.aaC.AaD.Bb

下面程序的运行结果是______。 include include fun(char*w,int n) { char 下面程序的运行结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) {t=*s1++;*s1=*s2--;*s2=t;} } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.7654321B.1714171C.1711717D.7177171

单选题有以下程序:#include #include void fun(int **s, int x[2][3]){ **s =*(x[1]+1);}void main(){ int a[2][3]={1,2,3,4,5,6},*p; p = (int *)malloc(sizeof(int)); fun(p,a); printf("%d",*p);}程序的运行结果是(  )。A5B2C6D3

单选题有以下程序#include void fun1(char *p){  char *q;  q=p;  while(*q!='\0') {   (*q)++;   q++; } }main(){ char a[]={Program},*p;  p=a[3];  fun1(p);  printf(%s,a); }程序执行后的输出结果是(  )。AProhsbnBPrphsbnCProgsbnDProgram

单选题有以下程序:#include void fun(char(*p)[6]){ int i; for(i=0;i4;i++)printf("%c",p[i][i]); printf("");}main(){ char s[6][6]={"ABCD","abcde","12345","FGHIJ","fghij","54321"}; fun(s);}程序的运行结果是(  )。AAa1FBAb3ICABCDDfghij

单选题有以下程序(程序中库函数islower(ch)用以判断ch中的字符是否为小写字母):#include #include void fun(char *p){ int i=0; while(p[i]) {  if(p[i]==' 'islower(p[i-1]))p[i-1]=p[i-1]-'a'+'A';  i++; }}main(){ char s1[100]=ab cd EFG!; fun(s1); printf(%s,s1);}程序运行后的输出结果是(  )。Aab cd EFG!BAb Cd EFg!CaB cD EFG!Dab cd EFg!